I am developing a web site using
JSP's that will be provided from
tomcat running on 2 web servers with the load distributed by a load sharing switch. This means that any one request could go to either server and so to either one of 2 (or more) JVM's. I need to save information about a clients session.
If this was running on 1 web server I would save the data as an object in the HttpSession (ie. using the request.getSession().setAttribute and request.getSession().getAttribute methods). In the API
doc it has one slightly criptic phrase [1] "When container migrates a session between VMs in a distributed container setting, all session attributes implementing the HttpSessionActivationListener interface are notified." This seems to indicate that in my situation it is possible to access the same instace of HttpSession across 2 or more JVM's though I am not sure how this would be done (perhaps by serializing the data in a cookie?). Unfortunatly the load bearing switch is not yet set up so I cannot
test it before I start coding.
Does anyone know if it is possible to share session data in this way? Thanks for any help.
Hugh
[1]
http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSession.html