jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: ItemNotFoundException when adding files from multiple threads
Date Mon, 10 Apr 2006 15:59:41 GMT
hi thomas,

the ItemNotFoundException is a bug; it is a side effect of a
legitimate error condition encountered during the save operation
(InvalidItemSateException).

i fixed the issue that caused the ItemNotFoundException being thrown
(svn r392978).

note that your test case still fails, this time with the correct
InvalidItemSateException since you're trying to concurrently modify
the same item from multiple threads. you can use locks to avoid
such situations.

see http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/5685/focus=5687

cheers
stefan

btw: posting the same issue concurrently in multiple threads is not
very helpful and doesn't improve response time...

On 4/6/06, thomasg <thomasgascoigne@hotmail.com> wrote:
>
> Hi guys,
>
> I've been trying to get multiple threads to add a file to the same
> workspace. Each thread gets its own session in its run() method, creates a
> nt:folder and adds a nt:file and nt:resource. One thread succeeds but all
> others fail with an ItemNotFoundException. The output is as follows:
>
>
> thread 1 added in 1343ms, logging out of session
> javax.jcr.ItemNotFoundException:
> 5cc05aef-5ad0-434a-9b47-4d7e3d3ba7be/{http://www.jcp.org/jcr/1.0}data
>         at
> org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.java:465)
>         at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:321)
>         at
> org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java:709)
>         at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1209)
>         at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:806)
>         at com.axxia.test.JackrabbitThreadTests.run(JackrabbitThreadTests.java:102)
> thread 0 caught repositoryexception in run():
> javax.jcr.ItemNotFoundException:
> 5cc05aef-5ad0-434a-9b47-4d7e3d3ba7be/{http://www.jcp.org/jcr/1.0}data
> thread 0 added in -1144342173968ms, logging out of session
>
> Anybody suggest what I'm doing wrong.
>
> Thanks, Thomas
> --
> View this message in context: http://www.nabble.com/ItemNotFoundException-when-adding-files-from-multiple-threads-t1407106.html#a3788575
> Sent from the Jackrabbit - Dev forum at Nabble.com.
>
>

Mime
View raw message