You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2008/11/20 11:06:44 UTC
[jira] Issue Comment Edited: (JCR-1868) Inconsistent state when
removing mix:lockable from a locked Node
[ https://issues.apache.org/jira/browse/JCR-1868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649308#action_12649308 ]
anchela edited comment on JCR-1868 at 11/20/08 2:06 AM:
-------------------------------------------------------
suggested fix:
add an extra check for the Node being lock if Node.removeMixin is called with "mix:lockable", similar to the corresponding check for existing references if an attempt is made to remove "mix:referenceable".
was (Author: anchela):
suggested fix:
add an extra check for the Node being lock if Node.removeMixin is call with "mix:lockable", similar the corresponding check for existing references if an attempt is made to remove "mix:referenceable".
> 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
> Attachments: JCR-1868.diff
>
>
> 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.