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

sessionDidActivate() and sessionWillPassivate()

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I might need some enlightment regarding the HttpSessionActivationListener interface.
You need to overridde 2 methods when implementing this interface: sessionDidActivate() and sessionWillPassivate().
These methods are called when the status of the session in a JVM is changed.

But when exactly is the sessionDidActivate() method triggered and when exactly is the sessionWillPassivate() method triggered ?
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when exactly is the sessionDidActivate() method triggered and when exactly is the sessionWillPassivate() method triggered ?


When an application is running in clustered environment (more than one server), only one object which moves across server is Session object in serialized form.

sessionWillPassivate - This method will be called before it moves from one server to others. Means container is informing that "Hey Dude, Keep your session object ready for serialization"

sessionDidActivate - This method will be called by the container when Session object transferred to other server is de-serialized. Means container is informing that "Just now session object is de-serialized".

hth,
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Closing as duplicate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic