cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <>
Subject RE: Synchronization on session object (was svn commit: r169856 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/http/
Date Mon, 23 May 2005 20:47:24 GMT
To quote Servlet spec SRV.7.7.3 "Within an application marked as distributable, all requests
that are part of a session must be handled by one JVM at a time."
I read that as "Concurrent requests must be dispatched to the same JVM - otherwise all bets
are off."

So any upstream load balancing in a cluster must use some sort of session affinity, and in
the same JVM the internalized session id is guaranteed to be unique.

Cheers, Alfred.

-----Original Message-----
From: Joerg Heinicke []
Sent: Montag, 23. Mai 2005 20:45
Subject: Re: Synchronization on session object (was svn commit: r169856

On 13.05.2005 11:37, Nathaniel Alfred wrote:

> I think synchronized(session) should never be used as vehicle to 
> coordinate concurrent requests because there is no convincing guarantee 
> that it is always working as expected.  
> Joerg, if you want to do it in your usercode, I don't mind, but please
> don't use it in common Cocoon code.  My propesed alternative of
> synchronized(session.getId().intern()) may look obscure but at least
> it is guaranteed to work.

I think we don't get a final answer to whether synchronized(session) is 
supposed to work or not. Your main concern seems to be complex 
environments like clusters. But how is session.getId().intern() supposed 
to work? Have the cluster nodes running by different JVMs and it does 
neither work. Or am I wrong?

This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

View raw message