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: threading problems
Date Fri, 16 Dec 2005 11:30:32 GMT
On 12/15/05, stephan lohwasser <stephan.lohwasser@systemone.at> wrote:
> this is what happens:
> javax.jcr.InvalidItemStateException:
> cafebabe-cafe-babe-cafe-babecafebabe has been modified externally
>     at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1371)
>     at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:765)
>     at
> at.systemone.wiki.threadthreat.JCRThreadTest$MyThread.run(JCRThreadTest.java:110)
>     at java.lang.Thread.run(Thread.java:595)
> do you knwo what i do wrong?

both sessions are concurrently modifying the root node and the exception thrown
is therefore correct. that's what i tried to explain to you in my previous mail:

if n threads modify the *same* item concurrently
only one thread will succeed and the others will get InvalidItemStateExceptions
informing them that their modifications have become stale.
this is by design. to prevent this you have to lock the node you're
working on.

see also


> cheers
> stephan

View raw message