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

Reply via email to