cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: Re: [IMP] synchronization on session object in Cocoon
Date Wed, 11 May 2005 15:29:55 GMT
Nathaniel Alfred <Alfred.Nathaniel <at>> writes:

> 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 

That's where you and I have different interpretations. The sentence you quoted
is IMO only about information hiding between different web applications. It does
not say anything about if it is guaranteed to have exactly one session object or

Another sentence is the following [1]: "The servlet container uses *this
interface* to create *a session* between an HTTP client and an HTTP server. The
*session persists* for a specified time period, *across more than one connection
or page request from the user*."

IMO this means _session_ is not only an abstract real world object, but a Java
object. And you can access the same session object on different requests of the
same (here "real world") session.

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

Yes, see Sylvain's proposal or my other mail.



View raw message