X/Open XA interface with two-phase commit
This implementation uses the X/Open Distributed Transaction Processing (X/Open DTP) standard with the two-phase commit XA protocol. With this connection type, the transaction manager coordinates syncpoint, rollback, commit, and failure recovery of all work that is involved in the unit of work, including queues and files and resources that are managed by the resource manager.
The X/Open DTP standard defines the concept of resource managers coordinated by a transaction manager. Relational databases such as DB2®, Informix®, Oracle, Sybase, and Microsoft SQL Server are typical resource managers. WebSphere® MQ is another example of a resource manager that is XA compliant. The transaction manager coordinates initiation and completion of a unit of work among these resource managers, therefore ensuring atomic integrity of the units of work.
The X/Open DTP model has the following functional components:
- Application program (AP)
The application program implements the desired business function. It specifies a sequence of operations that involve resources such as databases. An application program participates in one or more units of work, and might decide to commit or roll back each unit of work independently.
- Transaction manager (TM)
The transaction manager manages global transactions and coordinates the decision to commit them or roll them back, therefore ensuring their atomicity. The transaction manager also coordinates recovery activities of the resource managers when necessary, such as after a component failure.
- Resource manager (RM)
The resource manager manages a particular part of the shared resources of the computer. Many other software entities can request access to the resources from time to time, using services that the resource managers provide. Some resource managers manage a communications resource.
The following interfaces exist between the functional components in the basic X/Open DTP model:
- Application program-resource manager interface
Also referred to as the native interface, the application program-resource manager interface gives the application program access to shared resources. The X/Open DTP model imposes a few constraints on the native resource manager application program interface. Examples of such an interface are the embedded SQL or WebSphere MQ APIs.
- Application program-transaction manager interface
Also referred to as the TX interface, the application program-transaction manager interface allows the application program to delimit units of work. The transaction manager provides facilities (for example, EXEC CICS® SYNCPOINT) that allow the application program to start and complete units of work. The transaction manager completes units of work based upon a request from the application program and coordinates with the participating resource managers and other involved transaction managers. When this coordination is completed, the transaction manager returns the completion status to the application program.
- Transaction manager-Resource manager interface.
Also referred to as the XA interface, the application program-transaction manager interface allows the transaction manager to structure the work of resource managers into global transactions and coordinate global transaction completion and recovery. In the XA specification, the routines that each recovery manager provides for the transaction manager's use are the xa_routines. The routines that the transaction manager provides for the resource managers to call, form the ax_set. All of the xa_routines and the ax_set functions form a private interface between the transaction manager and the resource manager.