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 "Michael Dürig (JIRA)" <ji...@apache.org> on 2014/06/24 10:00:44 UTC

[jira] [Updated] (OAK-1909) addNode throws InvalidItemStateException instead of ItemExistsException

     [ https://issues.apache.org/jira/browse/OAK-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated OAK-1909:
-------------------------------

    Description: 
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:
{code}
try {
    retBucketNode = root.addNode(name, nodeType);
    session.save();
} catch (final ItemExistsException e) { 
    //…handle the failure via session.refresh(false)…
}
{code}

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

  was:
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.


> 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:
> {code}
> try {
>     retBucketNode = root.addNode(name, nodeType);
>     session.save();
> } catch (final ItemExistsException e) { 
>     //…handle the failure via session.refresh(false)…
> }
> {code}
> Note that you get an InvalidItemStateException instead of the expected ItemExistsException.



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