• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session in Distributed Environment  RSS feed

 
Luke Zechariah
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I ask my question let us assume a distributed environment with 2 JVM's.

In a distributed environment we know a HttpSession cannot co-exist on both the JVM's at the same time although servletContext can.

My question is Servlet A is accessing the HttpSession on JVM 1, at the same time if Servlet B also wants to access the same HttpSession from JVM 2, what will happen? Does the Servlet A completes, then the session passivates, goes from JVM1 to JVM2, then session activates, then serves the Servlet B.

Hope my question was clear. Thank you for helping me.
Thanks,
Luke.

PS: Preparing for SCWCD.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not clear on your question. Is sevrletB form a different request/user?
 
Nimit Shah
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In clustered environment I think all the requests from the same session goes to same server. Also there is some session sync mechanism (Not sure please check that).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!