You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Tommaso Teofili (JIRA)" <ji...@apache.org> on 2013/12/10 17:34:10 UTC

[jira] [Commented] (OAK-1272) Remove and create of same versionable node is seen as a change in uuid

    [ https://issues.apache.org/jira/browse/OAK-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13844399#comment-13844399 ] 

Tommaso Teofili commented on OAK-1272:
--------------------------------------

here's a sample testcase which highlights the reported (AFAIU wrong) behavior:
{code}
public void testRemoveAndCreateSameVersionableChildNode() throws Exception {
        // create parent
        Node parentNode = testRootNode.addNode("parent");
        parentNode.setPrimaryType("nt:unstructured");
        parentNode.setProperty("name", "sample");
        // crete a versionable child
        Node createdNode = parentNode.addNode("versionablechild", "nt:unstructured");
        createdNode.addMixin(JcrConstants.MIX_VERSIONABLE);
        superuser.save();

        VersionManager vm = superuser.getWorkspace().getVersionManager();
        vm.checkin(testRootNode.getPath()+"/parent/versionablechild");

        // delete and create exact same node
        Node parent = testRootNode.getNode("parent");

        // remove children
        NodeIterator nodes = parent.getNodes();
        while (nodes.hasNext()) {
            Node childNode = nodes.nextNode();
            childNode.remove();
        }
//        superuser.save(); // <-- enabling this makes the test pass

        // create again versionable child node
        Node recreatedNode = parent.addNode("versionablechild", "nt:unstructured");
        recreatedNode.addMixin(JcrConstants.MIX_VERSIONABLE);
        superuser.save();
    }
{code}

> Remove and create of same versionable node is seen as a change in uuid
> ----------------------------------------------------------------------
>
>                 Key: OAK-1272
>                 URL: https://issues.apache.org/jira/browse/OAK-1272
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, jcr
>    Affects Versions: 0.12
>            Reporter: Tommaso Teofili
>
> When trying to remove and create the very same versionable node in a same JCR session it seems the _VersionEditor_ sees that as a single change on the _jcr:uuid_ property if the node is checkedin and therefore it fails in saving the _Session_.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)