3 Replies Latest reply on May 30, 2013 9:43 AM by John Franey

    EAP 6.1.0 Beta: no transaction during transactional event observer, mysql xa driver

    John Franey Novice

      I expect a transaction to be active within my observer.  No?

       

       

      I am using mysql server 5.5.29, mysql jconnect driver: 5.1.25.

       

       

      This exception occurs with mysql's xa jbdc driver: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

      It does NOT occur with mysql's the non-xa jdbc driver.

       

       

      Thanks.

       

       

       

      @Stateless

      class EventHandler {

       

        @PersistenceContext

          EntityManager entityManager;

       

         public void onEvent(@Observes(during=AFTER_SUCCESS) MyEvent event) {

              try {

                serviceMethod(event.xxxx);

              } catch (Exception e) {

                 log exception -- see attachment

              }

         }

       

         // with or without:    @TransactionAttribute(REQUIRED)

         public void serviceMethod(XXXX xxxx) {

              XXXX x = entityManager.find(XXXX.class, xxx.getId());   // EXCEPTION: No transaction, see attachment

         }

       

      }

       

       

       

       

      This is copied from the attachment for convenience.  These are the last 'caused by' exceptions in the trace:

       

      Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error checking for a transaction

              at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:147)

              at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:70) [hibernate-entitymanager-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]

              at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:292) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]

              at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214) [hibernate-core-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]

              ... 147 more

      Caused by: javax.resource.ResourceException: IJ000460: Error checking for a transaction

              at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:362)

              at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

              at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:139)

              ... 150 more

      Caused by: javax.resource.ResourceException: IJ000459: Transaction is not active: tx=TransactionImple < ac, BasicAction: 0:ffff7f000101:-3717ed10:51a6117f:7b status: ActionStatus.COMMITTED >

              at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:352)

              ... 152 more