Lock token not removed from session when node is removed
--------------------------------------------------------

                 Key: JCR-1387
                 URL: https://issues.apache.org/jira/browse/JCR-1387
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 1.4
            Reporter: Carsten Ziegeler
            Priority: Minor


If a node is locked with session scope and then deleted through this session 
(without unlocking it before),
the lock token is still registed at the session and available through 
getLockTokens().

This is a test code:

    @org.junit.Test
    public void testLock() throws Exception {
        final Node parentNode = session.getRootNode();
        final Node node = parentNode.addNode("locktest", "nt:unstructured");
        node.addMixin("mix:lockable");
        parentNode.save();

        final javax.jcr.lock.Lock lock = node.lock(true, true);
        String token = lock.getLockToken();
        node.remove();
        parentNode.save();
        final List tokenList = Arrays.asList(session.getLockTokens());
        assertTrue("Token is still in session", !tokenList.contains(token));
    }

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

Reply via email to