When fail on connection occurs during commit call on AMQ XAResource implmementation then XA_RETRY error code of XAException is returned. This is correct for 2PC but it's not permitted by spec for 1PC.
The spec says for xa_commit() case:
The resource manager is not able to commit the transaction branch at this time.This value may be returned when a blocking condition exists and TMNOWAITwas set. Note, however, that this value may also be returned even whenTMNOWAIT is not set (for example, if the necessary stable storage is currentlyunavailable). This value cannot be returned if TMONEPHASE is set in flags. Allresources held on behalf of ∗xid remain in a prepared state until commitment ispossible. The transaction manager should reissue xa_commit() at a later time.
Please note what is said about one phase commit: This value cannot be returned if TMONEPHASE is set in flags.
AMQ behavior is currently against XA specification.
More of this this leads to fact that Narayana TM consider this as rolled backed transaction branch and so client receives `RollbackException` on return. That means that client consider this branch as rolled back.
This is wrong for case when connection is halt right after the time when JMS server commits its work but this information is not passed back to TM. That leads to fact that transaction is committed on JMS broker side but client is informed that it was rolled back.
By specification and what Narayana expects the correct return XA error code should be XAER_RMFAIL.
- is blocked by
-
JBEAP-3577 Upgrade Artemis to 1.1.0.wildfly-014
- Closed
- is related to
-
JBTM-2443 Raise a JTA HeuristicMixed if a one phase commit XAResource raises RMFAIL
- Closed
- is caused by
-
ARTEMIS-421 Loading...