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: InvalidItemStateException
Date Mon, 18 Jun 2007 10:50:14 GMT
On 6/18/07, KÖLL Claus <C.KOELL@tirol.gv.at> wrote:
> i get sometimes on an update operation of my node a InvalidItemStateException() with
the message
> 23588706-aaaf-4dc1-b4e6-d78b1c02be6a/{http://www.tirol.gv.at/dms/1.0}size: the item cannot
be saved because it has been modified externally.
> and i dont know the reason and how i can reproduce it ?
> can somebody explain me the reason ?

the message "the item cannot be saved because it has been modified
externally." means
that the item is stale, i.e. another has session has modified it.

Property p1 = (Property) session1.getItem("/some/property");
Property p2 = (Property) session2.getItem("/some/property");
p1.setValue("foo");
p2.setValue("bar");
p2.save();
p1.save();      // throws InvalidItemStateException

you can avoid this by locking the parent node.

cheers
stefan


>
> BR,
> claus
>

Mime
View raw message