IBM Books

Administration Guide


Transaction Manager (TM)

The transaction manager (TM) assigns identifiers to transactions, monitors their progress, and takes responsibility for transaction completion and failure. The transaction branch identifiers (known as XIDs) are assigned by the TM to identify both the global transaction and the specific branch within an RM. This is the correlation token between the log in a TM and the log in an RM. The XID is needed for two-phase commit, or rollback, to perform the resynchronization operation (also known as resync) on a system startup, or to let the administrator perform a heuristic operation (also known as manual intervention) if necessary.

After a TP Monitor is started up, it will ask the TM to open all the RMs that a set of application servers have defined. The TM will pass the xa_open calls to the RMs so that they can be initialized for DTP processing. As part of this startup procedure, the TM will perform the resync to recover all indoubt transactions. An indoubt transaction is a global transaction that was left in an uncertain state. This occurs when either the TM or at least one RM becomes unavailable after successfully completing the first phase (that is, the prepare phase) of the two-phase commit protocol. The RM will not know whether to commit or rollback its branch of the transaction until the TM can consolidate its own log with the RMs' when they become available again. To perform the resync operation, the TM will issue the xa_recover call one or more times to each of the RMs to identify all the indoubt transactions. The TM will compare the replies with the information in its own log to determine whether it should inform the RMs to xa_commit or xa_rollback those transactions. If an RM had already committed or rolled back its branch of an indoubt transaction through a heuristic operation by its administrator, the TM will issue an xa_forget call to that RM to complete the resync operation.

When a user application requests a commit or rollback, it must use the API provided by the TP Monitor or TM so that the TM can coordinate the commit and rollback among all the RMs involved. For example, when a CICS application issues the CICS SYNCPOINT request to commit a transaction, the CICS/6000* TM will in turn issue the XA calls such as xa_end, xa_prepare, xa_commit, or xa_rollback to request the RM to commit or rollback the transaction. The TM could choose to use one-phase instead of two-phase commit if only one RM is involved, or if an RM replies that its branch is read-only.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]