jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-1868) Inconsistent state when removing mix:lockable from a locked Node
Date Wed, 19 Nov 2008 17:11:44 GMT
Inconsistent state when removing mix:lockable from a locked Node
----------------------------------------------------------------

                 Key: JCR-1868
                 URL: https://issues.apache.org/jira/browse/JCR-1868
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core
            Reporter: angela


when the lock holder removes mix:lockable from a locked node, the lock related properties
get removed.
however, the lock still is live and present on the node.

i would have expected that either

- removing mix:lockable was not allowed or
- the lock was automatically released

test code:

    public void testRemoveMixLockableFromLockedNode() throws RepositoryException {

        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        testRootNode.save();

        Lock l = n.lock(true, true);
        n.removeMixin(mixLockable);
        n.save();

        assertFalse(n.isNodeType(mixLockable));                                <===== ok
        assertFalse(l.isLive());                                                         
          <===== lock is still live
        assertFalse(n.isLocked());                                                       
    <=====  node is still locked
        List tokens = Arrays.asList(superuser.getLockTokens());
        assertFalse(tokens.contains(l.getLockToken()));                    <=====  session
contains the token

        assertFalse(n.hasProperty(jcrLockOwner));                             <=====  ok.
prop got removed.
        assertFalse(n.hasProperty(jcrlockIsDeep));                             <===== 
ok. prop got removed.
        n.unlock();                                                                      
                  <===== LockException (node not lockable)
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message