This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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

Session Migration

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read one statement regarding session migration that said, "Make sure you session attribute class types are Serializable and you never have to worry about it". Again I read one more statement that said, "The Container is not required to use Serialization so there's no guarantee that readObject() and writeObject() methods will be called on a Serializable attribute."
These two statements made me confused whether to rely on session attributes that implement Serializable interface or to resort to HttpSessionActivationListener interface and use activation/passivation callbacks?
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Container must migrate any session attributes which are serializable, but it does not have to use serialization to accomplish this.

So if your attributes are all serializable you don't have a problem, but if there are some custom bits that would normally be serialized by writeObject() and readObject() then you will need to work around this as you say with the HttpSessionActivationListener
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic