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:

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();
$session = $request->getSession(true);

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...

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.


resin-interest mailing list

Reply via email to