You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by KÖLL Claus <C....@TIROL.GV.AT> on 2007/06/18 12:41:15 UTC

InvalidItemStateException

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 ?

BR,
claus

AW: InvalidItemStateException

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
hi stefan,
thanks for the information !

BR,
claus

-----Ursprüngliche Nachricht-----
Von: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com] 
Gesendet: Montag, 18. Juni 2007 12:50
An: dev@jackrabbit.apache.org
Betreff: Re: InvalidItemStateException

On 6/18/07, KÖLL Claus <C....@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
>

Re: InvalidItemStateException

Posted by Stefan Guggisberg <st...@gmail.com>.
On 6/18/07, KÖLL Claus <C....@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
>