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