I am porting an application from Jboss 7as to Weblogic 12c.
So far, I am able to run the application and create new records in the database.
However, I get the below error only when trying to update existing records;
Error committing transaction: javax.ejb.TransactionRolledbackLocalException: Error committing transaction: at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledbackLocal(EJBRuntimeUtils.java:231) at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:134) at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:362) at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:205) at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:46) ... Caused by: weblogic.transaction.internal.AppSetRollbackOnlyException: setRollbackOnly called on transaction
The error happens when I call javax.persistence.EntityManager.merge(Object)
inside a Stateless EJB whose transactions are container managed.
My initial thoughts were that the container is calling javax.transaction.UserTransaction.setRollbackOnly()
somewhere, so I changed the EJB's transaction management to BMT and managed the transaction myself. The same error occurred.
I suspect that my Datasource or persistence.xml have a problem.
Below is my persistence.xml's properties
org.hibernate.ejb.HibernatePersistence myDS
Please assist.