Transient error during commit results in HeuristicMixedException
alon3392 Jan 19, 2018 4:51 AMHello,
I tried a simple test (on narayana-jta 5.7.1) with XAResource returning XAER_RMFAIL on commit(), signaling a transient error.
If there is more than one enlisted instance of such XAResource, TransactionManager.commit() would finish without exception, it just logs warning message for each resource that returned XAER_RMFAIL, and at some latter time recovery manager will try to commit again.
All as expected.
However, if there is only one XAResource, TransactionManager.commit() fails with:
17:40:48.061 [main] WARN com.arjuna.ats.jta - ARJUNA016039: onePhaseCommit on < formatId=131077, gtrid_length=31, bqual_length=36, tx_uid=0:ffff0a01011f:d796:5a61bd20:2, node_name=me1, branch_uid=0:ffff0a01011f:d796:5a61bd20:3, subordinatenodename=null, eis_name=0 > (p1.XaRes1@6c629d6e) failed with exception XAException.XAER_RMFAIL
javax.transaction.xa.XAException: null
at p1.XaRes1.commit(XaRes1.java:32)
at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:702)
at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2386)
at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1497)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:96)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1289)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
at p1.Test1.main(Test1.java:48)
17:40:48.061 [main] WARN com.arjuna.ats.arjuna - ARJUNA012084: One-phase commit of action 0:ffff0a01011f:d796:5a61bd20:2 received heuristic decision: TwoPhaseOutcome.HEURISTIC_HAZARD
Exception in thread "main" javax.transaction.HeuristicMixedException
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1297)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
at p1.Test1.main(Test1.java:48)
Suppressed: javax.transaction.xa.XAException
at p1.XaRes1.commit(XaRes1.java:32)
at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:702)
at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2386)
at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1497)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:96)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1289)
This doesn't seem right. Not only that it fails with exception, but it fails with HeuristicMixedException. Such exception also causes heuristic participant entry being written in transaction log (that entry can only be removed manually)
Thanks.