jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: Session.clone()
Date Thu, 24 Mar 2011 15:25:47 GMT

Why do you want to clone the session in the first place? Wouldn't it be 
better to prevent the session from timing out? Probably by pinging it 


On 24.3.11 16:03, Thomas Mueller wrote:
> Hi,
> Use case:
> a) I have a web application where a user can login to Jackrabbit.
> b) There is a (Jackrabbit-) session timeout of 30 minutes (which is
> required to avoid out of memory).
> c) Now some operations potentially take longer than 30 minutes, for
> example data store garbage collection.
> d) For those operations, I would like to use a new session, but don't
> want that the user has to login again (it would be a usability problem).
> e) Therefore, I would like to clone the existing session (create a
> additional, new session with the exact same user and access rights).
> Currently there is no 'official' way to clone a session (create a new
> session for the same user). There is a way that works / worked for some
> cases:
> SimpleCredentials sc = new SimpleCredentials(null, "".toCharArray());
> (or ew SimpleCredentials(session.getUserID(), "".toCharArray());)
> session.impersonate(sc);
> But this feels kind of 'hacky' (the spec doesn't explicitly state this
> is allowed, and the method name is weird). I wonder if we should add a
> new method:
> JackrabbitSession JackrabbitSession.clone();
> What do you think? If yes, should I also add an issue for JSR-333?
> Regards,
> Thomas

View raw message