Hi,

On Fri, Jan 15, 2010 at 14:02,  <[email protected]> wrote:
> Hi
>
> I'm using jackrabbit in a multi-threaded application.
>
> I have used ThreadLocal to confine the Jackrabbit Session to a single thread
> and see no issues executing simultaneous threads except the following
> scenario:-
>
> - I want to create one node of type "nt:folder" and then have child nodes
> creating under it.
> - I attempt to get the node (of type "nt:folder") first.
> - If I receive PathNotFoundException, then I create the node (of type
> "nt:folder") and save the session.
> - Some threads create extra nodes of the same name although the node exists?
>
> I've tried quite a few synchronization strategies, but no success. I haven't
> tried node locking.

what's the type of the parent node where the threads will create
nt:folder nodes?

it seems that the node type allows same name sibling child nodes.

but even if you changed that you may run into another exception. after
trying to get a node and catching the PathNotFoundException, another
thread may have created the node meanwhile. so you probably have to
catch another exception: ItemExistException when trying to add the
folder node and saving it. that's kind of ugly, but will probably
work. otherwise you should use locking.

regards
 marcel

> Any help would be appreciated.
>
> Regards
>
> George Sibley

Reply via email to