We are having problems with in-memory session replication in Glassfish v2ur1 with our custom application. We currently have 3 machines: das-dev, gfish-dev01 and gfish-dev02. Das-dev is the DAS configured with a cluster named cluster1, gfish-dev01 has instance1 and gfish-dev02 has instance2. We are fronting the cluster with an apache2 proxy server (gfproxy-dev01) with mod_proxy_balancer configured with stickysession and the appropriate routes. We have also enabled the jvmRoute option on the cluster and the AJP_INSTANCE_NAME system-properties for each instance, as described here:
http://blogs.sun.com/jluehe/entry/supporting_apache_loadbalancer_with_glassfish.
With the sample clusterjsp application deployed to the cluster, everything works as expected. When you access
http://gfproxy-dev01/clusterjsp you are proxied to one of the appservers. When you reload the page, you keep the same sessionid and you stay on the same instance. When you disable the instance you were being forwarded to you are forwarded to the other instance and retain the same sessionid. So, all is good with this setup and the clusterjsp application.
However, when we deploy our custom app with in-memory session replication configured, you are randomly assigned new sessionids (I have confirmed that the proxy is forwarding to the same instance each time) when refreshing the page or just browsing the app. The application has the <distributable/> tag in the web modules web.xml and it was deployed with the availability option enabled.
When we change the persistence type to file and have the sessions directory on a shared file system, the custom app behaves as we expect; you keep the same session id, stay on the same instance and when stopping the instance you were being served by, you move to the other instance and retain your sessionid.
Please let me know what additional information I can provide.
Any help would be greatly appreciated.
Paul
[Message sent by forum member 'paul_h' (paul_h)]
http://forums.java.net/jive/thread.jspa?messageID=277149