jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fran├žois Cassistat...@maya-systems.com>
Subject Item cannot be saved because it has been modified externally: node /
Date Fri, 10 Dec 2010 23:12:47 GMT
Hi list !

I've got some concurrency problem while saving. My application use distinct Sessions object
and when two processes are trying to modify the same property of the same node at the same
time. I've get the exception below :
javax.jcr.InvalidItemStateException: Item cannot be saved because it has been modified externally:
node /
        at org.apache.jackrabbit.core.ItemImpl.getTransientStates(ItemImpl.java:249)
        at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:981)
        at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:920)
        at com.myproject.MyProject.save(MyProject.java:1525)
        ...


I have tried saving this way :
synchronized (this)
{
    session.refresh(true);
    session.save();
}


Is there any way around or only locks and transactions can prevent that ?


Thanks !


Fran├žois


Mime
View raw message