XA transaction support for commitment control

DB2 Universal Database™ (UDB) for iSeries™ can participate in X/Open global transactions.

The Open Group has defined an industry-standard model for transactional work that allows changes made against unrelated resources to be part of a single global transaction. An example of this is changes to databases that are provided by two separate vendors. This model is called the X/Open Distributed Transaction Processing model.

The following publications describe the X/Open Distributed Transaction Processing model in detail:

Be familiar with the information in these books, particularly the XA Specification, before attempting to use the XA transaction support provided by DB2® UDB for iSeries. You can find these books at the Open Group Web site.

There are five components to the DTP model:

Application Program (AP)
It implements the required function of the user by specifying a sequence of operations that involves resources such as databases. It defines the start and end of global transactions, accesses resources within transaction boundaries, and normally makes the decision whether to commit or roll back each transaction.
Transaction Manager (TM)
It manages global transactions and coordinates the decision to start them and commit them, or roll them back in order to ensure atomic transaction completion. The TM also coordinates recovery activities with the RMs after a component fails.
Resource Manager (RM)
It manages a defined part of the computer's shared resources, such as a database management system. The AP uses interfaces defined by each RM to perform transactional work. The TM uses interfaces provided by the RM to carry out transaction completion.
Communications Resource Manager (CRM)
It allows an instance of the model to access another instance either inside or outside the current TM domain. CRMs are outside the scope of DB2 UDB for iSeries and are not discussed here.
Communication Protocol
The protocols used by CRMs to communicate with each other. This is outside the scope of DB2 UDB for iSeries and is not discussed here.

The XA Specification is the part of the DTP model that describes a set of interfaces that is used by the TM and RM components of the DTP model. DB2 UDB for iSeries implements these interfaces as a set of UNIX® platform-style APIs and exit programs. See XA APIs for detailed documentation of these APIs and for more information about how to use DB2 UDB for iSeries as an RM.

iSeries Navigator and XA transactions

iSeries Navigator supports the management of XA transactions as Global Transactions.

A Global Transaction might contain changes both outside and within DB2 UDB for iSeries. A global transaction is coordinated by an external Transaction Manager using the Open Group XA architecture, or another similar architecture. An application commits or rolls back a global transaction using interfaces provided by the Transaction Manager. The Transaction Manager uses commit protocols defined by the XA architecture, or another architecture, to complete the transaction. DB2 UDB for iSeries acts as an XA Resource Manager when participating in a global transaction. There are two types of global transactions:

Considerations for XA transactions

Start of changeThe XA APIs for transaction-scoped locks are recommended for new users of the XA transaction support. The XA APIs for job-scoped locks will continue to be supported, but no longer have any advantages over the XA APIs for transaction-scoped locks. The XA APIs for transaction-scoped locks have fewer restrictions and better performance in the following situations:End of change

In these situations, a separate job must be started to run XA transaction branches when you use the XA APIs for Job Scoped Locks.

Understand the following considerations and restrictions before using DB2 UDB for iSeries as a RM. The term thread refers to either a job that is not thread capable, or a single thread within a thread capable job.

The following considerations apply to both transactions with transaction-scoped locks and transactions with job-scoped locks unless noted otherwise.

DB2 UDB for iSeries considerations

Embedded SQL considerations

CLI considerations

Remote relational database considerations

Note: These considerations for a remote relational database apply only to transactions with job-scoped locks.

Recovery consideration

Transaction branch considerations

Related concepts
Considerations for XA transactions
Open Group Web site
SQL server mode and thread-scoped transactions for commitment control
Related tasks
When to force commits and rollbacks and when to cancel resynchronization