Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

What to do if session is migrated between JVM?

 
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
 
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
 
I'm doing laundry! Look how clean this tiny ad is:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic