try
{
// Marked rollback
if (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK)
{
tx.rollback();
}
else
{
// Commit tx
// This will happen if
// a) everything goes well
// b) app. exception was thrown
tx.commit();
}
In the case of an asynchronous rollback (timeout) the tx status is STATUS_ROLLEDBACK and so the commit causes:
12:35:09,391 ERROR [LogInterceptor] TransactionRolledbackException in method: pu
blic abstract void org.jboss.test.tm.interfaces.TxTimeout.testOverriddenTimeoutE
xpires() throws java.rmi.RemoteException, causedBy:
java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjuna
core.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The
transaction is not active!
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.c
ommit(TransactionImple.java:223)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
T.java:502)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
Shouldn't the commit happen only is status is STATUS_ACTIVE ?