jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suhail M. Ahmed" <ilya...@mac.com>
Subject Re: Lifetime of a session?
Date Wed, 02 Mar 2005 16:46:12 GMT
Hi Sylvain,

The Session object is returned on performing a login on the repository. 
Looking at RepositoryIml you will see

  Session ses = new XASessionImpl(this, lc, wspInfo.getConfig());
  activeSessions.put(ses, ses);

You should I think couple the repository session life cycle to your 
http session life cycle. I haven't dug deeper in to the object graph 
derived from session so I can't say anything about the thread safety of 
Item and its sub classes. I do see some nifty synchronization in the 
content store implementation so I would think that at that level things 
are thread safe. I think the optimum route is to use a session listener 
to login and logout from the repository.


On Mar 2, 2005, at 4:38 PM, Sylvain Wallez wrote:

> Hi all,
> I'm wondering what is the expected lifetime of a Session, especially 
> in the context of a webapp.
> Is it a lightweight object that can be created anew for each browser 
> request, or can it be stored in the user's session, or should it be 
> pooled and shared between users like a JDBC connection?
> Also, what about a Session's thread safety? The spec doesn't say 
> anything about it.
> Thanks for your answers,
> Sylvain
> -- 
> Sylvain Wallez                                  Anyware Technologies
> http://www.apache.org/~sylvain           http://www.anyware-tech.com
> { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message