AnsweredAssumed Answered

Issue with transaction when using JCR in workflow

Question asked by yashwant_gangwar on Sep 11, 2009
Hi,

I am getting  Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) when we try to checkout a node.

The scenario is:

A rule to run a workflow when a content is added in the space. I add couple of file in this folder. The workflow is designed to move the content to other folder and version the folder. As we version nodes using JCR whenever a new file is added, the first file versions the folder correctly but as soon as the second workflow checkouts the node corresponding to the folder we are getting following error:

org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [org.alfresco.repo.domain.hibernate.NodeImpl] with identifier [4587]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.alfresco.repo.domain.hibernate.NodeImpl#4587]
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.alfresco.repo.domain.hibernate.NodeImpl#4587]
        at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
        at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
        at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:322)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:306)

        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183)

        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus…..

I know is issue with transactions. But we have put all our code in synchronized and we are saving  the session using session.save(); and also logging out properly from session.

Still we getting the same error? Any help is appreciated.

Regards,
Yashwant

Outcomes