File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session in Distributed Environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Session in Distributed Environment" Watch "Session in Distributed Environment" New topic

Session in Distributed Environment

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 128
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.

PS: Preparing for SCWCD.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Not clear on your question. Is sevrletB form a different request/user?

So much trouble in the world -- Bob Marley
Nimit Shah
Ranch Hand

Joined: Jul 02, 2007
Posts: 55
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).
I agree. Here's the link:
subject: Session in Distributed Environment
jQuery in Action, 3rd edition