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.

Reply via email to