[ http://issues.apache.org/jira/browse/JCR-230?page=all ]
Stefan Guggisberg resolved JCR-230:
-----------------------------------
Resolution: Fixed
fixed in svn r344339.
thanks edgar for finding this one!
> persistent locks persist even after removing the locked node
> ------------------------------------------------------------
>
> Key: JCR-230
> URL: http://issues.apache.org/jira/browse/JCR-230
> Project: Jackrabbit
> Type: Bug
> Components: locks
> Reporter: Edgar Poce
> Assignee: Stefan Guggisberg
> Priority: Minor
> Fix For: 1.0
>
> I read my post to the mailing list and I realized it wasn't clear at all :( .
> So I decided to upload the code to reproduce the error.
> RepositoryConfig conf =
> RepositoryConfig.create("/temp/repository/repository.xml",
> "/temp/repository/repository");
> Repository repo = RepositoryImpl.create(conf);
>
> // Session 1 creates a locked node
> Session s1 = repo.login(new SimpleCredentials("user1",
> "pwd1".toCharArray()));
> Node root1 = s1.getRootNode() ;
> Node test1 = root1.addNode("test") ;
> test1.addMixin("mix:lockable");
> s1.save() ;
> test1.lock(false, false);
> s1.logout() ;
>
> // Session 2 deletes the node and create a new one
> // with the same path
> Session s2 = repo.login(new SimpleCredentials("user2",
> "pwd2".toCharArray()));
> s2.getRootNode().getNode("test").remove();
> Node test2 = s2.getRootNode().addNode("test");
> s2.save() ;
> // the next line returns true :(
> System.out.println(test2.isLocked()) ;
> // the next line will throw an exception
> test2.addMixin("mix:lockable") ;
> javax.jcr.lock.LockException: Node locked.
> at
> org.apache.jackrabbit.core.lock.LockManagerImpl.checkLock(LockManagerImpl.java:449)
> at
> org.apache.jackrabbit.core.lock.LockManagerImpl.checkLock(LockManagerImpl.java:435)
> at org.apache.jackrabbit.core.NodeImpl.checkLock(NodeImpl.java:3847)
> at org.apache.jackrabbit.core.NodeImpl.addMixin(NodeImpl.java:964)
> at org.apache.jackrabbit.core.NodeImpl.addMixin(NodeImpl.java:2420)
> at org.apache.jackrabbit.core.LockTest.main(LockTest.java:55)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira