jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi goel <Ruchi.G...@Sun.COM>
Subject Re: unlocking a locked node in session scope
Date Mon, 07 May 2007 09:11:15 GMT
Thanks. Let me try your code snippet  from an rmi client and see if that 
works fine. Then , may be I can conclude that it is jcr-mapping layer 
issue.

Regards
Ruchi

Stefan Guggisberg wrote:
> hi ruchi
>
> On 5/4/07, ruchi goel <Ruchi.Goel@sun.com> wrote:
>> Hi,
>>    I locked a node in a session where lock is session scoped. Now I
>> logout from the session without unlocking .  When I again login by same
>> user  (or by any other user)  , the  node.isLocked () returns true.
>>
>> Via jcr-mapping PersistenceManager , I am not able to do save, remove
>> because checkIfNodeLocked throws back exception.
>>
>>
>> As per jcr specs , the lock should expire along with the session but
>> that is not happening.
>> Even if I logout explicitly, rerun the repository , I still see
>> jcr:lockOwner property value set to "superuser" who locked the node.
>> I am using RMI for accessing repsoitory.
>> Am I missing something ?
>>
>
> i quickly ran a test using the following code snippet:
>
> <code>
> Session s = r.login(new SimpleCredentials("johndoe",
> "".toCharArray()), wspName);
> Node n = s.getRootNode().getNode("lockTest");
>
> Lock lck = n.lock(true, true); // session-scoped, deep lock
> tn.setProperty("blah", "blah");
> s.logout();
>
> Session s1 = r.login(new SimpleCredentials("johndoe",
> "".toCharArray()), wspName);
>
> System.out.println("Lock#isLive=" + lck.isLive());
> System.out.println("Node#isLocked=" +
> s1.getRootNode().getNode("lockTest").isLocked());
> </code>
>
> the (correct) console output is:
>
> Lock#isLive=false
> Node#isLocked=false
>
>
> i am not familiar with the jcr-mapping code. i assume your issue is 
> either
> jcr-mapping or jcr-rmi related.
>
> please create a jira issue and attach a simple test case (if possible).
>
> cheers
> stefan
>
>>
>> help appreciated.
>>
>> Thanks,
>> Ruchi
>>
>>
>>
>>


Mime
View raw message