Distributed transaction processing model
The X/Open standard for distributed transactions defines a model for distributed transaction processing. In this model, a coordinating transaction manager manages how each data source processes a transaction, based on its knowledge of all the data sources that participate in the transaction. The data sources that normally manage their own transaction commit and recovery delegate this task to the transaction manager.
- An application program that defines transaction boundaries and specifies actions that constitute a transaction
- Resource managers, such as databases or file systems that provide access to shared data sources
- A transaction manager that assigns identifiers to transactions, monitors their progress, and manages transaction completion and failure recovery
The XA specification defines the two-phase commit protocol as the interface that is used for communication between a transaction manager and a resource manager. The two-phase commit protocol includes a prepare phase and a commit phase. During the prepare phase, all participants in the transaction must agree to complete the changes that are required by the transaction. If any of the participants reports a problem, the prepare phase fails, and the transaction is rolled back. If the prepare phase succeeds, the commit phase starts. During the commit phase, the transaction manager instructs all participants to commit the transaction.
In the Distributed Transaction stage, when WebSphere MQ is the transaction manager, data sources such as IBM DB2® and Oracle can participate in an XA transaction as resource managers.
For more information about the X/Open standard, see Distributed Transaction Processing: The XA Specification, which is available from http://opengroup.org.