jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes please explain? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "please explain?" Watch "please explain?" New topic

please explain?

samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
When container migrates a session between VMs
in a distributed container setting,
all session attributes implementing the HttpSessionActivationListener interface are notified.

When container migrates a session between VMs
please explain this line
Graham Lewis

Joined: Sep 25, 2005
Posts: 6
Hi - This is my understanding and please forgive me if I state the obvious.

Java runs on a Virtual Machine (VM), i.e. it is not compiled code native of the systems architecture, and runs in an environment that sits on top of the operating system. Java web applications can be run across multiple VMs which may (or may not) be on different machines - the management of this is done by the Web/Application server - the container.

In order to migrate or move a session to a different VM - without loosing the session state (attributes etc.) - the container needs to ensure that the VM on the receiving side has everything it needs to keep the session going and make it look to the user like nothing has happend.

Hope this makes sense.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Java web applications can be run across multiple VMs which may (or may not) be on different machines

Graham is on the right track, but this sentence is a bit misleading. A web app is rarely run across multiple JVMs, it's more likely run on multiple JVMs. That means the same web app runs on several servers. If the servers are clustered, then the sessions are distributed, meaning that each session lives on several machines, although only one of them actually serves the client. But if that machine goes down, the next request can go to any other of the machines in the cluster, and -since the session has been duplicated to all the machines in the cluster- the request can be handled as if it was on the original machine, because the session is there in full. For that to work, all objects in a session need to implement the Serializable interface.
I agree. Here's the link: http://aspose.com/file-tools
subject: please explain?
jQuery in Action, 3rd edition