We have a business usecase where we need to delete a set of rows in a transaction!
The Object graph is very simple. Object 1 has CASCADE ALL as its attribute FYI:
Object 1 > One-to-Many > Object 2We need to delete
Object 2 entries.
On a local integration testing environment - we use
org.springframework.transaction.jta.JtaTransactionManager for deleting the Hibernate entities -
which works. However, when deployed on the server, we use
org.springframework.transaction.jta.WebSphereUowTransactionManager which throws this error:Quote:
0000002a RegisteredSyn E WTRN0074E:
Exception caught from before_completion synchronization operation: javax.persistence.EntityNotFoundException: deleted entity passed to persist:
[com.cmb.businessengine.apps.fileimport.core.domain.FileImportStatistics#<null>]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:525)
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke
(WebSphereExtendedJTATransactionLookup.java:142)
at $Proxy98.beforeCompletion(Unknown Source)
at com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:242)
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2449)
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1675)
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1646)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1581)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:247)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:168)
at com.ibm.ws.uow.UOWManagerImpl.uowCommit(UOWManagerImpl.java:1056)
at com.ibm.ws.uow.UOWManagerImpl.uowEnd(UOWManagerImpl.java:1026)
at com.ibm.ws.uow.UOWManagerImpl.runUnderNewUOW(UOWManagerImpl.java:976)
at com.ibm.ws.uow.UOWManagerImpl.runUnderUOW(UOWManagerImpl.java:510)
at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:252)
Can anyone suggest why it would pass when using
org.springframework.transaction.jta.JtaTransactionManager but fails when using
org.springframework.transaction.jta.WebSphereUowTransactionManager?