jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller" <thomas.tom.muel...@gmail.com>
Subject Re: Concurrent addNode (Was: [jira] Commented: (JCR-1552) Concurrent conflicting property creation sometimes doesn't fail)
Date Thu, 24 Apr 2008 17:41:01 GMT
Hi,

>  The best solution IMHO is not to allow SNS in the first place.

Yes, unfortunately it's not the default behavior. And making it the
default would break XML import.

>  Another solution would be a custom getOrAddNode() method, like the one
>  I've implemented

        try {
            return parent.getNode(name);
        } catch (PathNotFoundException e) {
            return parent.addNode(name, type);
        }

Uhm, looks a bit ugly, and still doesn't always work with multiple
threads (two threads can't get the node, both will create one)? Or do
you mean something else?

It's probably a bit late to add an atomic getOrAddNode into JSR-283 I
guess... But we could add it to the Jackrabbit API anyway if we want
to.

Regards,
Thomas

Mime
View raw message