0 Replies Latest reply on Jun 5, 2008 8:35 PM by jonathandfields

    An @Observer method throws no tx ex after raiseTransactionSuccess

    jonathandfields

      Hi,


      I have two @Stateful EJB components, both session scoped, both with extended persistence contexts. I'm trying to have one component update its state to reflect the results of a transaction in the other component.


      In one component method I call:


      Events.instance().raiseTransactionSuccessEvent("changeEvent")


      In the other component I have:


      @Observer("changeEvent")
      public void handleChangeEvent() {
          // Re-query to reflect changes
      }


      The method is also declared on the @Local interface.
      I have also tried it with the @Transactional annotation.


      However, in both cases, I receive the following (abbreviated) exception:


      11:05:24,093 ERROR [TxPolicy] IllegalStateException while setting transaction for rollback only
      java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!


      ...


      11:05:24,171 ERROR [SynchronizationRegistry] Exception processing transaction Synchronization after completion
      javax.ejb.EJBTransactionRolledbackException: No active JTA transaction on joinTransaction call



      ...



      Caused by: javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
              at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:469)



      Any suggestions what I'm doing wrong? Do I need to start and commit the transaction myself, with UserTransaction?


      Thanks!