Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What to do if session is migrated between JVM?

 
xiaoma wang
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, everyone:
I have a question: how to handle the attributes stored in the session when this session is migrated from one JVM to another? I know the a new session is going to be created since session belong to the context. But how about the attributes in the session? They are re-enter into the new session automatically?
Thanks in advance!
Xiaoma Waang
 
Jason Chaw
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, the session data values must be of types that implement java.lang.Serializable, so that the distributed JVM can accept the HttpSession object. (please ref. Servlet spec.)
But I think the most safe way to storge application data is to storge them into EJB or Database.
 
xiaoma wang
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, Janson:
You suggestion is right. Save in the ejb or database is a good idea, if multiple JVMs are involved in the web design.
Thank you very much!
Xiaoma Wang
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic