Hi Marcel One thing I forgot to mention in the post is that I don't experience the same behaviour on the folder nodes created under those first level folder nodes. My bad.
So this could be the answer. One thing though. How do I get the top level node to be created by the system? Sorry, still getting up to speed with jackrabbit. Many thanks for your help. regards George -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Marcel Reutegger Sent: 15 January 2010 21:28 To: dev Subject: Re: Jackrabbit Multi Threading Issue Hi, the root node indeed allows same name sibling child nodes. I suggest you move everything one level down. something like: root root-folder folder1 sub-folder1 content1 content2 sub-folder2 content1 content2 folder2 ........ where root-folder is nt:folder and is created initially by the system. regards marcel On Fri, Jan 15, 2010 at 16:22, <[email protected]> wrote: > Hi Marcel > > Many thanks for the reply. > > Sorry should've made things clearer. > > The "nt:folder" nodes are added to the root node. We then add further > "nt:folder" nodes hanging off these nodes, and then a mixture of other > nodes (e.g. "jcr:content"). E.g:- > > root > folder1 > sub-folder1 > content1 > content2 > sub-folder2 > content1 > content2 > folder2 > ........ > > Regards > > > George > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf Of Marcel > Reutegger > Sent: 15 January 2010 14:46 > To: dev > Subject: Re: Jackrabbit Multi Threading Issue > > 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 >
