You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by smjain <ja...@gmail.com> on 2010/10/28 17:40:49 UTC

javax.jcr.InvalidItemStateException: Item cannot be saved because it has been mo dified externally: node /

I keep getting this error while adding nodes under root/test/ 
I use this code String unique =UUID.randomUUID().toString() to generate a
unique id for the child node
javax.jcr.InvalidItemStateException: Item cannot be saved because it has
been mo
dified externally: node /
Pls help.This is urgent

Thanks
Shashank

-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/javax-jcr-InvalidItemStateException-Item-cannot-be-saved-because-it-has-been-mo-dified-externally-no-tp3017490p3017490.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: javax.jcr.InvalidItemStateException: Item cannot be saved because it has been mo dified externally: node /

Posted by smjain <ja...@gmail.com>.
Thanks for the prompt reply.
I am generating a unique name for every request. Also synchronized the call
to the save. but I still see this error.

What I tried is to create some structure like this

root/test/1 
root/test/2
root/test/3 
...

root/test/10

And then just allowing threads to write into 1 ,2 ,3 and not under root/test
directly. That reduced the occurances but still its there..
Thoughts?

Thanks
Shashank

-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/javax-jcr-InvalidItemStateException-Item-cannot-be-saved-because-it-has-been-mo-dified-externally-no-tp3017490p3018367.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: javax.jcr.InvalidItemStateException: Item cannot be saved because it has been mo dified externally: node /

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Oct 28, 2010 at 6:40 PM, smjain <ja...@gmail.com> wrote:
> I keep getting this error while adding nodes under root/test/
> I use this code String unique =UUID.randomUUID().toString() to generate a
> unique id for the child node
> javax.jcr.InvalidItemStateException: Item cannot be saved because it has
> been mo dified externally: node /
> Pls help.This is urgent

Please don't post the same message repeatedly.

This InvalidItemStateException is caused by concurrent modifications
that Jackrabbit fails to merge automatically. For example, this often
happens when two concurrent clients try to add a child node with the
same name.

Good ways of dealing with this exception are either to manually merge
the changes and retry the save() call, or to explicitly synchronize
concurrent writers using JCR locking or some other synchronization
mechanism.

BR,

Jukka Zitting