Laurie byrum created OAK-1909:
---------------------------------

             Summary: addNode throws InvalidItemStateException instead of 
ItemExistsException
                 Key: OAK-1909
                 URL: https://issues.apache.org/jira/browse/OAK-1909
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: mongomk
            Reporter: Laurie byrum


We are doing some testing with active-active on mongomk. We have some code that 
creates a node and the same node can be created by multiple 
instances/threads/whatever. The node will look exactly the same regardless of 
who creates it, and we don't care who creates it, we just want it to exist. On 
mongomk, if 2 threads create the same node, we get an 
InvalidItemStateException. I would have expected an ItemExistsException, based 
on 
http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html?is-external=true

To repro, run this code in 2 threads:
               try {
                 retBucketNode = root.addNode(name, nodeType);
// Save the newly created bucket
                 session.save();
                } catch (final ItemExistsException e) { …handle the
failure via session.refresh(false)…}

Note that you get an InvalidItemStateException instead of the expected 
ItemExistsException.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to