Global (XA) transactions with IMS TM Resource Adapter
A global (XA) transaction is controlled and coordinated by an external transaction manager (external coordinator) to a resource manager.
The transaction normally requires coordination across multiple resource managers that may reside on different platforms. The transaction must be sent to IMS Connect as send-then-commit (commit-mode 1) with a sync level of syncpoint.
To access an enterprise information system, the external coordinator sends an XID, which is defined by the X/Open XA standard, to a resource adapter. In addition to the length and FormatID fields, an XID has two other parts: the global transaction identifier (GTRID) and the branch qualifier (BQUAL). Because IMS does not support X/Open XA protocol, the IMS TM Resource Adapter uses the LocalTransaction and XAResources interfaces to participate in transactions coordinated by the external coordinator to communicate with IMS Connect. IMS Connect maintains the XID and associates it with a work context token and an IMS name. IMS Connect then passes the context token to z/OS® Resource Recovery Services (RRS).
IMS Connect sends the transaction output back to the IMS TM Resource Adapter which returns the output data to the client. Upon sending the output message to the IMS TM Resource Adapter successfully, IMS Connect sends an ACK to IMS to acknowledge the message. After making requests to IMS, the application component indicates to the IMS TM Resource Adapter that it is ready to commit the changes. At this point the IMS TM Resource Adapter sends a prepare signal to IMS Connect. IMS Connect, in turn, tells RRS to initiate the prepare phase. If the IMS resource manager is prepared to commit, RRS collects the prepare to commit confirmation from the resource manager and sends the results to IMS Connect. IMS Connect will then send a request to commit signal to the IMS TM Resource Adapter to request committing the changes.
When the IMS TM Resource Adapter receives the request to commit signal, it tells the external coordinator that the resources on the IMS system can be committed. The transaction manager determines the overall results. If all the resource managers can commit, the transaction manager hardens the commit decision and will drive the IMS TM Resource Adapter to commit the change. The IMS TM Resource Adapter sends a commit signal to IMS Connect and IMS Connect tells RRS that the overall decision is to commit all resources. RRS tells IMS to commit the changes. After IMS commits the changes, RRS then returns to IMS Connect with the information that the local resources have been committed. IMS Connect tells RRS to delete its log records.
If support for cascading global transactions is enabled by the specification of CASCADE=Y in either the IMS Connect system configuration or IMS Connect data store definitions, IMS Connect and IMS can process a global transaction when IMS Connect and IMS are each running on different z/OS images (LPARs). When support for cascading global transactions is disabled, IMS Connect, RRS, and IMS must all be on the same LPAR.
The following series of figures illustrate the flow of distributed two-phase commit global transactions between IMS TM Resource Adapter and IMS in different configuration scenarios.
The following figure shows the flow of a single two-phase commit transaction between IMS TM Resource Adapter and a single IMS system. In the figure, IMS Connect and IMS are running on the same LPAR.