Overview
The Abstract X/Open DTP Model
This chapter provides a brief introduction to transaction processing in an XA-compliant environment, then describes the role that the DB XA Module plays in that environment. Here are definitions of some of the terms used in this chapter:
A
transaction is a unit of work that consists of an application-specific sequence of operations.
A
transaction processing system defines and coordinates interactions between multiple users and databases. The goal of a transaction processing system is to carry out transactions in an efficient, reliable and coordinated way. The success of a transaction is measured against four critical objectives known as the ACID (Atomicity, Consistency, Isolation, Durability) properties.
A
distributed transaction processing (DTP) system is a form of transaction processing that supports transactions whose operations are distributed among different computers or among different databases from different vendors. A
local transaction involves one service within a single server program, and accesses only one database. A
global transaction involves several services, which might be located in different server programs. A global transaction is also called a
distributed transaction.
Figure 1 illustrates where the DB XA Module fits in an X/Open DTP environment. As shown in the figure, the X/Open DTP model consists of three main parts:
An
application program (AP) that defines the boundaries of a transaction and specifies the actions that constitute a transaction.
A
resource manager (RM) that provides access to shared data. Usually a resource manager is a database server or a file-access system.
A
transaction monitor (TM) that manages the routing and transaction processing control of a service request. The TM manages global transactions and coordinates their resolution and any failure recovery.
A path of communication between any two parts of the X/Open DTP Model is called an
interface. As shown in
Figure 1, the DTP model has the following interfaces:
The
AP-RM interface:
The AP-RM interface allows an application program to call a resource manager directly, using the RM’s native API, when the transaction does not need to be managed by the TPM. The AP-RM interface allows the AP to perform database connection management, transaction management, and database manipulation.
When the requested transaction must be managed by a TPM through the XA interface, however, the TPM becomes responsible for managing the database connections and transactions. To perform database manipulations under these circumstances, the AP requires the connection handles of the connections opened by TPM. The AP uses an XA-specific native API to fetch the database connection handles, and then uses these connection handles for data manipulation through the native API.
The
AP-TM interface: This is also known as the TX interface. It lets the application program call the transaction monitor to request transaction management. X/Open defines an API for starting and ending transactions, directing the completion of a transaction, and obtaining status information about transactions. This interface must be supported by all X/Open-compliant TPMs.
The
TM-RM interface:
This is also known as an XA interface. It allows two-way communication between the transaction monitor and the resource manager, and implements the two-phase commit between them. As an XA interface, it provides the standard set of routines described in the XA specification. The transaction monitor uses these routines to manage global transactions.