Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1175

XA transaction rollback failure throws the wrong exception and fails to cleanup the transaction table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 5.0.0.CR7
    • 5.0.0.CR5
    • Transactions
    • None

      I'm getting an NPE, as tx is null at org.infinispan.transaction.TransactionTable.failureCompletingTransaction(Transaction tx)

      being invoked from org.infinispan.transaction.TransactionCoordinator.rollback(LocalTransaction)
      which has this code:

      LocalTxInvocationContext ctx = icc.createTxInvocationContext();
            ctx.setLocalTransaction(localTransaction);
            try {
               invoker.invoke(ctx, rollbackCommand);
               txTable.removeLocalTransaction(localTransaction);
            } catch (Throwable e) {
               txTable.failureCompletingTransaction(ctx.getTransaction());
               log.errorRollingBack(e);
               throw new XAException(XAException.XA_HEURHAZ);
            } finally {
               icc.suspend();
            }

      you cant see that a localtransaction is set on the context, but then ctx.getTransaction() is passed to the failing method. This variable was unset.

      so basically I debugged it already but I'm not sure how this should be solved.

      This is currently reproducible by running org.infinispan.lock.APITest (as it fails for some other reason)

              mircea.markus Mircea Markus (Inactive)
              sgrinove Sanne Grinovero (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: