jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torg...@pobox.com>
Subject Re: "Unable to lock node. Node has pending changes: /counter"
Date Thu, 29 Jun 2006 12:22:27 GMT
Jukka Zitting wrote:
> Hi,
> 
> On 6/20/06, Torgeir Veimo <torgeir@pobox.com> wrote:
>> On Tue, 2006-06-20 at 12:12 +0200, Marcel Reutegger wrote:
>> > well, you can reuse the session, but you must not shared it among
>> > multiple threads. Unless you synchronize access to the session.
>>
>> What's the recommended practice with web application? doing a login and
>> logout for each request?
> 
> There are a number of different patterns with different benefits and
> drawbacks. Some examples:
> 
> 1) Session per request. This is the simplest solution but not very
> performant at least with the Jackrabbit architecture.

I tried doing this, by doing a new login per request, but when the 
method returns a Node, yet still does a session.logout(), the Node 
itself seems to be unsable, as I get an exception;

javax.jcr.RepositoryException: this session has been closed
         at 
org.apache.jackrabbit.core.SessionImpl.sanityCheck(SessionImpl.java:340)
         at 
org.apache.jackrabbit.core.ItemImpl.sanityCheck(ItemImpl.java:154)
         at org.apache.jackrabbit.core.NodeImpl.getName(NodeImpl.java:1714)
[...]

So it seems that as long as any objects retrieved from a session is 
still used, one cannot log out from the session. Correct?


-- 
-Torgeir

Mime
View raw message