4 Replies Latest reply on Jan 25, 2012 5:21 AM by tomjenkinson

    java.lang.IllegalStateException: BaseTransaction.commit - [com.arjuna.ats.internal.jta.transaction.arjunacore.notx]

    ap.roland

      We are using JBoss 4.2.0 and commiting transactions to MySql database.

      For some instances (see 'recipient' in the code) we are getting this error:

       

      java.lang.IllegalStateException: BaseTransaction.commit - [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] no transaction!

      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:130)

      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)

      at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140

       

      This is our sample code:

       

      for (Recipient recipient : recipients) {

      UserTransaction ut = null;

      try {

      ut = ServiceLocator.getInstance().getUserTransaction(); // perform JNDI lookup

      ut.setTransactionTimeout(transactionTimeout);

      ut.begin();

      // ... some changes of recipient

      ut.commit(); // throws java.lang.IllegalStateException .. no transaction!

      }

      } catch (Exception e) {

      // Go to rollback transaction ut

      }

       

      Can someone give us some advice on what could be causing this

      exception?

      Thanks in advance!