Originally posted by Timber Lee: how does the HttpSession move from one JVM to another? thanks for help!
That is implementation dependent. But the spec mandates that it must be consistent with the Java serialization mechanism. That means, as a developer, you can assume that it will behave as if it were moved using the serialization mechanism.
In a distributed application, an application can be deployed onto multiple servers (multiple JVMs on same or different machines). When a series of client interaction is participating in a session, the container (app server) generally serves all requests for that client from one JVM. But if that server is brought down (for maintenance or crashes), then container serves subsequent requests a second JVM. In order to preserve the client session, the container must "move" the HttpSession associated with that client. That implementation is container dependent, but the application must be programmed to "distributable" for the container to move and not throw exceptions Rama
The container may also move a session for load balancing purposes. But the session may only be processing requests at one single server at any given time. - Peter
posted 17 years ago
Moving sessions for load-balancing purposes sounds kinda confusing to me. Assume several frames send (almost simultaneous) requests to the app server from the same client. If the app server balances these requests by sending to different JVMs (due to load), then do sessions migrate back and forth before these requests are processed? 'cos all these requests should still be are part of the same session, you'd think. On a side note, weblogic 6.X seems to pin all requests in a session to one JVM, until it has to fail-over. Rama