Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6663

UserTransaction.rollback() must not throw IllegalStateException if getStatus()==STATUS_ROLLEDBACK

    XMLWordPrintable

Details

    Description

      When a timeout has occurred, UserTransaction.getStatus() returns STATUS_ROLLEDBACK. Calling UserTransaction.rollback() at this point will throw the following IllegalStateException:

      java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1473)
      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
      at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.rollback(ServerVMClientUserTransaction.java:148)

      The JTA specification says about when UserTransaction.rollback() may throw IllegalStateException: "IllegalStateException Thrown if the current thread is not associated with a transaction." Since getStatus() does return STATUS_ROLLEDBACK (and not STATUS_NO_TRANSACTION), the thread obviously still is associated with a transaction.

      Apart from breaking the JTA contract, this effectively renders the UserTransaction useless since begin() will also throw exception.

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-jhallida Jonathan Halliday
              joerg.frantzius Jörg von Frantzius (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: