XA support for a sysplex by the IBM Data Server Driver for JDBC and SQLJ

WebSphere® Application Server and the IBM Data Server Driver for JDBC and SQLJ can be used to coordinate distributed transactions using XA protocols supported by DRDA.

This type of XA support is only available for transaction managers that use a single-transport processing model. In a single-transport model, a transaction, over a single transport (physical connection), is tied to a member from xa_start to xa_end. The transaction end is followed immediately by xa_prepare(readonly), xa_prepare plus xa_commit or xa_rollback, or xa_rollback. All of this must occur within a single application process. An example of a transaction manager that uses this model is IBM® WebSphere Application Server.

Support for the single-transport processing model also includes indoubt transaction recovery where member information for each recoverable transaction is retrieved through xa_recover, which allows xa_commit or xa_rollback to be directed at the specified member.

Important: When a global transaction runs, locks are shared among branches of the global transaction only if those branches run on the same data sharing member. When sysplex workload balancing is enabled, there is no guarantee that all branches run on the same data sharing member. As a result, an application that uses global transactions and sysplex workload balancing might experience deadlocks or timeouts.

To use XA support with client applications, you need to set up dynamic virtual IP addresses. A dynamic IP address needs to be configured for the Db2 group, and one address must be set up for each Db2 member in the group. For XA recovery to be processed on any member after failure, information on indoubt XIDs must be obtained from the SCA. The SCA contains the list of indoubt XIDs for the entire group, as well as each member's DVIPA and the resync port of the member that owns the indoubt thread. XA recovery returns the list of all prepared or heuristically committed threads for the entire group back to the XA Transaction Manager (TM). The IBM Data Server Driver for JDBC and SQLJ uses the information to send the commit decision to the owning member, when the XA TM recovers, and then commits or rolls back indoubt XIDs.

For the recovery process to function properly, you must set up the group DVIPA. the following figure illustrates how the XA recovery process, that is described above, works. After a system failure, XA recover requires the list of indoubt transactions identified by XA XIDs, to be returned to the group. In this example, if member DB1G fails, DB1G will leave an indoubt thread. The state of the thread, as well as related XIDs, is contained in the log of the DB1G member. The DB1G indoubt thread XID is also contained in the group's XA indoubt list, in the SCA. When WebSphere tries to recover from the system failure, the IBM Data Server Driver for JDBC and SQLJ sends the XA Recover command to any member of the group. The member then returns the group's list of indoubt XIDs from reading the XA indoubt list in the SCA. When WebSphere commits or rollbacks the indoubt thread, the IBM Data Server Driver for JDBC and SQLJ sends the decision to member DB1G, which resolves the indoubt thread.
Figure 1. The XA recovery process
Begin figure description. The XA recovery process runs on a Windows client, the SCA coupling facility, and the XID is indoubt. End figure description.