jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger" <Felix.Meschber...@day.com>
Subject Re: Session pool (was : loading javaclasses-node mapping files in multiuser environment)
Date Sat, 19 May 2007 10:48:39 GMT
Hi Christophe,

I took a very simple assumption, which luckily is correct in our specific
context: I only pool Sessions which are acquired through SimpleCredentials
and I completely ignore any JAAS context and Credentials attributes and I
only accept SimpleCredentials with matching username/password pairs.

To implement better session pooling which would also take JAAS into account
would probably require to get at the Subject from the current JAAS context
and use this as a key for the session pool map. On the other hand, you would
have to keep in mind, that if you use a session pool, you would hand out
Session instances unsing a Subject internally, which is not the Subject
"given" to the login method. This might pose issues.

In the end of day, I think, that session pooling should probably not be
implemented on top of the repository outside of all the credentials stuff,
unless you completely control the authentication process.

Re performance: This was actually the reason for me to implement the session
pooling. Logging in had such a big impact (we use custom authentication and
login handlers) that it was worth it implementing such a pool. Actually, if
I remember correctly, the performance impact was mostly due to the
authentication stuff. Not sure, how performance behaves today, but if you
have to execute the real login on any access to a pooled session, you would
probably not gain anything.

I would be very interested in hearing of your findings regarding the session
pool.

Hope this helps a bit ?

Regards
Felix

On 5/19/07, Christophe Lombart <christophe.lombart@gmail.com> wrote:
>
> Felix,
>
> Concerning the session pool, are you using the same credentials for each
> session in the pool or a null value ? I need to build a session pool in a
> couple of weeks and I'm wonder how to setup one in a context where we are
> also using JAAS.  Following the spec, if the credentials is null, the repo
> should obtain the identity by calling the method getSubject.  So, I expect
> I'm still need to make a login/logout for each request. Is it acceptable
> in
> term of performance ?
>
> br,
> Christophe
>
>
> On 5/18/07, Felix Meschberger < Felix.Meschberger@day.com> wrote:
> >
> > Hi Ruchi,
> >
> > I do in fact do the same. After having looked at the code, it seems,
> that
> > the mappers etc. do not have any instance data, which would cause
> > collisions
> > situations. An in fact, it proved rather stable.
> >
> > But then, I also do not store the JCR sessions in an HTTPSession to
> > prevent
> > concurrency issues. Instead I implemented session pooling and just
> provide
> > each request its own session, which is returned to the pool on logout.
> >
> > Regards
> > Felix
> >
> > On 5/18/07, ruchi goel <Ruchi.Goel@sun.com> wrote:
> > >
> > > Hi,
> > >    I am using OCM (jcr-mapping ) to access jackrabbit repository.
> > >
> > >
> > >
> > > To get  persistenceManager , I am doing the following :
> > >
> > > Class PMSetUp{
> > >
> > >
> > >     private static QueryManager queryManager;
> > >
> > >     private static Mapper mapper;
> > >
> > >     private static AtomicTypeConverterProvider converterProvider;
> > >
> > >     private static ObjectConverter objectConverter;
> > >
> > >     private static pmIsInitiaized = false;
> > >
> > >     public void init(){
> > >         String path =  "." + fs + "config";
> > >         files[0] = path + fs + "portalCMS_jcrmapping.xml";
> > >
> > >         //set up OCM
> > >         mapper = new DigesterMapperImpl(files);
> > >         converterProvider = new DefaultAtomicTypeConverterProvider();
> > >         Map atomicTypeConverters =
> > > converterProvider.getAtomicTypeConverters();
> > >         queryManager = new QueryManagerImpl(mapper,
> > atomicTypeConverters);
> > >         objectConverter = new ObjectConverterImpl(mapper,
> > > converterProvider);
> > >         pmIsInitiaized = true;
> > >      }
> > >
> > >      public PersistenceManager getPersistenceManager(HttpRequest
> > > request) throws CMSException {
> > >        if (!pmIsInitialized){
> > >           init();
> > >           }
> > >           return new PersistenceManagerImpl(mapper, objectConverter,
> > > queryManager, request.getSession().getAttribute("jcrSession");
> > >     }
> > > }
> > >
> > > In case of single user environment , the above works fine. My question
> > > is in case of multiuser environment also, can I have querymanager,
> > > mapper etc.as static since they are not dependent on user session.
> > >
> > >
> > > Thanks,
> > > Ruchi
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message