4 Replies Latest reply on Aug 17, 2011 3:53 AM by adamw

    Envers causing a rollback during Seam @Asynchrounous call


      My team and I are having an issue getting envers to work within a Seam @Asynchronous call.  Specifically, we are using a quartz task to trigger a method call on an ongoing basis.  We introduced Envers recently to start tracking history of a bean in our application.  Enves works like a charm from the front end of the application, but when it is utilized duing the @Asynchronous call we get the following error:


      javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.

      javax.transaction.RollbackException: Transaction marked for rollback.

              at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:449)

              at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:371)

              at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3817)

              at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3596)

              at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1379)

              at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)

              at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205)

              at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:83)


      I understand that Envers does its work at the point that the database session is closed.  Also, we determined that envers was the culprit for this problem by removing the listener and related classes, and the persist duing the @Asynchronous call starts to work again.


      Is there something I have to do special during an @Asynchrounous call to accomodate envers?


      I appreciate the help on this issue.