XA transaction failure with 3 involved servers
Environment
- JBoss Enterprise Application Platform [EAP] 6
Issue
- Setup/ call sequence:
- client invokes EJB A on server A,
- on server A
- Container on A starts tx,
- EJB A updates record in database and
- invokes remotely EJB B on server B
- on server B
- EJB B again invokes a datasource and
- invokes EJB C on server C,
- on server C
- EJB C updates record in database.
- During invocation/transaction in flight server B crashes and get restarted
- as some tx-branches get committed while other get rolled-back the outcome is inconsistent.
Resolution
- Apply EAP 6.4.CP8 or higher
- Please be aware that this will improve behaviour, but the risk that transactions will end in state "heuristic" will still exist.
- An XA transaction has an inherent risk of This content is not included.Heuristic_Outcomes by definition of the Content from en.wikipedia.org is not included.2PC-protocol. This is due to the Coordinator/Transaction Manager being unable to resolve issues (network or server outage) occurring during the commit phase.
- Usually you may assume, the shorter the prepare and commit phases, the lower the risk that something breaks, and the more complex the XA topology, the higher the probability of failure. So please keep the setup as simple as possible.
- Even with Content from issues.jboss.org is not included.JBTM-2575 and further enhancements in EAP7 you need to be prepared
- to monitor for heuristics, see This content is not included.Manage_Transactions, and
- to take administrative actions to compensate.
Root Cause
- When checking for orphaned subordinate transactions in the middle of a tree branches that are eligible for orphan detect
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.