cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <Alfred.Nathan...@swx.com>
Subject RE: Re: [IMP] synchronization on session object in Cocoon
Date Wed, 11 May 2005 12:43:29 GMT
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Joerg Heinicke
> Sent: Mittwoch, 11. Mai 2005 13:50
> To: dev@cocoon.apache.org
> Subject: Re: [IMP] synchronization on session object in Cocoon
...
> > But the String pool comes to the rescue.  This should work for all
> > sessions within the same JVM:
> >
> >    synchronized(session.getId().intern()) {
> >       ...
> >    }
> 
> That's not more than a work around IMO.
> 
> Furthermore your interpretation seems not to be common sense in Cocoon
> project:
> 
> "synchronized[ ]?\(session\)" - 16 matches in project Cocoon 2.1.7
> 
> core:
> org.apache.cocoon.Cocoon (1 match)
> 
> authentication-fw:
> org.apache.cocoon.webapps.authentication.generation.Configurat
> ionGenerator
> (1 match)
> 
> portal-fw:
> org.apache.cocoon.webapps.portal.components.PortalManagerImpl 
> (4 matches)
> 
> session-fw:
> org.apache.cocoon.webapps.session.components.DefaultFormManage
> r (2 matches)
> org.apache.cocoon.webapps.session.components.DefaultContextManager (5
> matches)
> org.apache.cocoon.webapps.session.components.DefaultSessionMan
> ager (1 match)
> 
> xsp:
> org.apache.cocoon.components.xscript.XScriptManagerImpl (1 match)
> org.apache.cocoon.components.language.markup.xsp.XSPUtil (1 match)
> 
> Joerg

AFAIKS is the purpose of the existing synchronized(session) bits to
protect the consistency of the session object in case it is shared
between parallel executing requests.

IIUC you need a lock object to really synchronize parallel requests.  
There I'd say the session is the wrong candidate due to the mentioned
possible dependency on the servlet container.

I am just afraid that keeping the wrapped sessions in a private map
may introduce a memory leak.  But maybe WeakHashMap would take care
of this...

Cheers, Alfred.
 
 
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.

Mime
View raw message