Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1961

Improper Exception thrown on concurrent versioned node changes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • core 1.4.8
    • None
    • jackrabbit-core, versioning
    • None
    • ubuntu 7.10 - the Gutsy Gibbon Sun JDK 1.5.0_13

    Description

      When two sessions connected through two separate repositories but backed by the same database make non conflicting changes to the same versioned node, an InvalidItemStateException is thrown. I'll attach a test project that when built displays this error but essentially the code is the following:

      Node node1 = session1.getRootNode().getNode(baseNodeName);
      Node node2 = session2.getRootNode().getNode(baseNodeName);

      node1.checkout();
      Node child1 = node1.addNode(UUID.randomUUID().toString(), "nt:folder");
      child1.addMixin("mix:versionable");
      child1.checkout();
      node1.save();
      child1.checkin();
      node1.checkin();

      node2.checkout();
      Node child2 = node2.addNode(UUID.randomUUID().toString(), "nt:folder");
      child2.addMixin("mix:versionable");
      child2.checkout();
      node2.save();
      child2.checkin();
      node2.checkin();

      The above code throws the following exception on the node2.checkout() call.

      javax.jcr.InvalidItemStateException: de6b39ce-1ec6-43e2-ba0e-2966341e6aff/

      {http://www.jcp.org/jcr/1.0}

      predecessors has been modified externally
      at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1251)
      at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:897)
      at org.apache.jackrabbit.core.NodeImpl.checkout(NodeImpl.java:3004)
      at concurrent.version.test.ConcurrentVersionNodeAddTest.testConcurrentNodeAdd(ConcurrentVersionNodeAddTest.java:89)

      or

      javax.jcr.InvalidItemStateException: e384b5f6-0fcd-4853-962c-0085901cdcce/

      {http://www.jcp.org/jcr/1.0}

      isCheckedOut has been modified externally
      at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1251)
      at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:897)
      at org.apache.jackrabbit.core.NodeImpl.checkout(NodeImpl.java:3004)
      at concurrent.version.test.ConcurrentVersionNodeAddTest.testConcurrentNodeAdd(ConcurrentVersionNodeAddTest.java:89)

      Based on JCR-584[1], it would seem that since the change to the node is being merged properly that the versioning should be able to merge its information properly as well. The difference between the merging of nodes and this version exception is the fact that one is a node and other are properties. Now while I would like properties to be merged nicely (it would eliminate some other problems I'm having), since I can't control conflicting changes in how the versioning is managed it seems appropriate that it should merge nicely.

      [1] -https://issues.apache.org/jira/browse/JCR-584

      Attachments

        1. concurrent-version-test.tar.gz
          3 kB
          Micah Whitacre

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkwhitacre Micah Whitacre
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: