We are using cluster store assuming I've understood the config
file/documentation. I'm sure that roll over isn't the problem. I've never seen a case were an active session moved from one server to the other UNLESS I shut down a server so I'm sure our load balancer is leaving them where they are unless that server goes down. I've also verified that the clustering is working as designed by taking a server off line and continuing the process on the remaining server. Doing so doesn't seem to cause this problem. We can not reliably reproduce this so it is hard to test. I know I have reproduced it without the session hopping servers. Other relevant facts: Resin 3.1.3, using more or less the default config file... >From the webapp-default section of the server config: <persistent-store type="cluster"> <init path="session"/> </persistent-store> <session-config> <enable-url-rewriting>false</enable-url-rewriting> <use-persistent-store>true</use-persistent-store> <session-timeout>300</session-timeout> <reuse-session-id>true</reuse-session-id> <always-save-session>true</always-save-session> <always-load-session>true</always-load-session> </session-config>Andrew Scott Ferguson wrote: Cluster store.On Mar 13, 2008, at 8:39 AM, Andrew Fritz wrote:We have a 2 node cluster behind a commodity load balancer with sticky sessions. We are using PHP for front end pages, but all of our buisness objects are Java and are saved/loaded from our DB via Hibernate. We store php variables and objects in the php $_SESSION and that works great. We store java objects in the java session via the $request->getSession() (which I assume is the same as the request variable I would have available in a JSP page, or the HttpServletRequest parameter in a servlet). More or less randomly, the session will drop a value (or perhaps not store it to begin with). The scenario I am working with is this:What kind of distributed sessions are you using? cluster store? If you're just relying on sticky sessions, then you could see that issue if the load balancer decided to rollover to the other server for some reason. -- Scott A request to the start page for a multiform section of the site creates a blank object, populates it with some default values (based on how the user entered the wizard), and places it in the java session: $memory = new MemoryBO(); $memory->setWhatever("somevalue"); $session = $request->getSession(true); $session->setAttribute("wizard.memory",$memory); and then serves up the first form (an AJAX search page). The user finds what they need and clicks the appropriate link which submits the form. The page receiving the request attempts to get the blank object from the session and populate it: $session = $request->getSession(true); $memory = $session->getAttribute("wizard.memory"); *** if (empty($memory)) return error status... $memory->setWhatever("somevalue"); ... In about 1 out of 100 cases the if statement above flagged by "***" will fire the return error statement. This happens randomly, and happens more frequently after a restart or redeploy. It should also be noted that we were originally putting the java objects in the $_SESSION variable. They always failed to serialize, (and thus were lost on restart/deploy) but otherwise worked EXACTLY the same as using the java session. The value mysteriously disappears. I've dug through the logs with log level "fine". We can not reproduce the bug at all on our non-clustered development environment. Andrew _______________________________________________ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest_______________________________________________ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest |
_______________________________________________ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest