Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
4.96 Mб

X/Open Distributed Transaction Processing (DTP)

See Also:

X/Open CAE Specification - Distributed Transaction Processing: The XA Specification for a general overview of XA, including basic architecture. You can obtain a copy of this document by requesting X/Open Document No. XO/CAE/91/300 or ISBN 1 872630 24 3 from X/Open Company, Ltd., 1010 El Camino Real, Suite 380, Menlo Park, CA 94025, U.S.A.

Oracle Call Interface Programmer's Guide for background and reference information about the Oracle XA library

The Oracle Database platform-specific documentation for information on library linking filenames

File README.doc, located in a directory specified in the Oracle Database platform-specific documentation for a description of changes, bugs, and restrictions in the Oracle XA library for your platform. Various XA files can be found at %ORACLE_ HOME%/rdbms/demo.

X/Open Distributed Transaction Processing (DTP)

The X/Open DTP architecture defines a standard architecture or interface that allows multiple application programs to share resources, provided by multiple, and possibly different, resource managers. It coordinates the work between application programs and resource managers into global transactions.

Figure 16–1 illustrates a possible X/Open DTP model.

A resource manager (RM) controls a shared, recoverable resource that can be returned to a consistent state after a failure. For example, Oracle Database is an RM and uses its redo log and undo segments to return to a consistent state after a failure. An RM provides access to shared resources such as a database, file systems, printer servers, and so forth.

A transaction manager (TM) provides an application program interface (API) for specifying the boundaries of the transaction and manages the commit and recovery procedures.

Normally, Oracle Database acts as its own TM and manages its own commit and recovery. However, using a standards-based TM allows Oracle Database to cooperate with other heterogeneous RMs in a single transaction.

16-2 Oracle Database Application Developer's Guide - Fundamentals

X/Open Distributed Transaction Processing (DTP)

A TM is usually a component provided by a transaction processing monitor (TPM) vendor. The TM assigns identifiers to transactions, and monitors and coordinates their progress. It uses Oracle XA library subroutines to tell Oracle Database how to process the transaction, based on its knowledge of all RMs in the transaction. You can find a list of the XA subroutines and their descriptions later in this section.

An application program (AP) defines transaction boundaries and specifies actions that constitute a transaction. For example, an AP can be a precompiler or OCI program. The AP operates on the RM's resource through the RM's native interface, for example SQL. However, it starts and completes all transaction operations through the transaction manager through an interface called TX. The AP itself does not directly use the XA interface

Figure 16–1 One Possible DTP Model

TX Interface

Application Program




XA Interface







XA Interface














Using Oracle XA with Transaction Monitors 16-3

X/Open Distributed Transaction Processing (DTP)


Note: The naming conventions for the TX interface and associated subroutines are vendor-specific, and may differ from those used here. For example, you may find that the tx_open call is referred to as tp_open on your system. To check terminology, see the documentation supplied with the transaction processing monitor.

Required Public Information

As a resource manager, Oracle Database is required to publish the following information.

XA Feature

Oracle Database Details




The Oracle Database xa_switch_t structure name for


static registration is xaosw. The Oracle Database xa_


switch_t structure name for dynamic registration is


xaoswd. These structures contain entry points and other


information for the resource manager.

xa_switch_t resource manager

close string

The Oracle Database resource manager name within the xa_switch_t structure is Oracle_XA.

The close string used by xa_close() is ignored and is allowed to be null.

open string

The format of the open string used by xa_open() is


described in detail in "Defining the xa_open String" on


page 16-9.


Libraries needed to link applications using Oracle XA


have platform-specific names. It is similar to linking an


ordinary precompiler or OCI program except you may


have to link any TPM-specific libraries. If you are not


using sqllib, then be sure to link with $ORACLE_




None. The functionality to support XA is part of both


Standard Edition and Enterprise Edition.



16-4 Oracle Database Application Developer's Guide - Fundamentals

Соседние файлы в папке Oracle 10g