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/19 18:11:44 UTC
[jira] Created: (JCR-1868) Inconsistent state when removing
mix:lockable from a locked Node
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.
[jira] Issue Comment Edited: (JCR-1868) Inconsistent state when
removing mix:lockable from a locked Node
Posted by "angela (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (JCR-1868) Inconsistent state when removing
mix:lockable from a locked Node
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela updated JCR-1868:
------------------------
Attachment: JCR-1868.diff
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.
[jira] Updated: (JCR-1868) Inconsistent state when removing
mix:lockable from a locked Node
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela updated JCR-1868:
------------------------
Component/s: jackrabbit-jcr2spi
> 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, jackrabbit-jcr2spi
> Reporter: angela
> Fix For: 1.6.0
>
> 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.
[jira] Resolved: (JCR-1868) Inconsistent state when removing
mix:lockable from a locked Node
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela resolved JCR-1868.
-------------------------
Resolution: Fixed
Fix Version/s: 1.6.0
> 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, jackrabbit-jcr2spi
> Reporter: angela
> Fix For: 1.6.0
>
> 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.