![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
HP OpenVMS Programming Concepts Manual
30.7.2 Nonstandard XA FunctionsThis section describes the following DECdtm Veneer extensions to the standard XA interface. Use of these functions is optional.
ax_bind_decdtm_2
Makes a connection to DECdtm or starts recovery processing. Format#include <xa.h> Parameters
DescriptionAn application calls ax_bind_decdtm_2() to bind a resource manager into the local process, as follows: Return Values
See Also
ax_close_decdtm
Closes all statically bound resource managers. Formatint ax_close_decdtm (void) DescriptionThis function is provided to allow an implementation of the X/Open TX specification to implement tx_close(). Return Values
See Also
ax_lock_decdtm
Prevents the XA Veneer from making asynchronous calls to resource managers. Format#include <xa.h> DescriptionAn application program or resource manager may call ax_lock_decdtm() to prevent the XA Veneer from issuing XA calls to resource managers. This ensures that the Veneer cannot make a call to an RM to end and roll back a transaction while the RM is concurrently processing a call from the application. Return Values
See Also
ax_open_decdtm
Opens all statically bound resource managers. Formatint ax_open_decdtm (void) DescriptionThis function is provided to allow an implementation of the X/Open TX specification to implement tx_open(). Return Values
See Also
ax_unbind_decdtm
Disconnects a resource manager from DECdtm. Format#include <xa.h> Parameters
DescriptionA dynamically bound resource manager calls ax_unbind_decdtm() to disconnect itself from DECdtm. On receiving the ax_unbind_decdtm() call, DECdtm calls xa_close(). Return Values
Related Information
ax_unlock_decdtm
Allows the XA Veneer to make asynchronous calls to resource managers again. Format#include <xa.h> DescriptionThis function removes the lock requested by ax_lock_decdtm(). Return Values
See Also
The XA Gateway is configured into each TP process as an XA-compliant resource manager. It handles XA calls from the XA TM and maps these into DECdtm system services. This causes DECdtm to send the appropriate events to any DECdtm compliant Resource Manager (RM) used in a TP process.
The operation of the Gateway is transparent to the RM; DECdtm RMs do
not need any modification to be used with the Gateway.
The XA Gateway uses a log file to record the mapping between XA transactions and DECdtm transactions. The log file is managed by the Gateway server process DDTM$XG_SERVER. As of Version 2.1, HP DECdtm/XA Gateway has clusterwide transaction recovery support. Transactions from applications that use a clusterwide DECdtm Gateway Domain Log can be recovered from any single-node failure. Gateway servers running on the remaining cluster nodes can initiate the transaction recovery process on behalf of the failed node. Use the XGCP utility (described in Section 30.7.4 of this manual) to create the Gateway log. The size of the log file depends on the number of concurrently active transactions. Each active transaction requires up to 600 bytes, depending on the size of the transaction ID used by the XA TM. However, the log expands automatically when required. The log file is created in the directory specified by the logical name SYS$JOURNAL and has a name of the form SYSTEM$name.DDTM$XG_JOURNAL. For optimum performance, move each Gateway log and each DECdtm log to a separate physical device, and define SYS$JOURNAL as a search list for the set of physical devices. The XA Gateway requires an association on each OpenVMS Cluster node between an XA transaction manager and the XA Gateway log. You manage this association by specifying a Gateway name as follows:
You must configure all XA applications run on the local node with the same Gateway name. XA applications using the same name cannot run on other OpenVMS Cluster nodes. Therefore, you should normally define one Gateway name and create one log for each node of an OpenVMS Cluster. However, you can move a Gateway name to a different node, provided that the Gateway log can be accessed from that node. Move the name to another node as follows:
Take care to protect against the loss of a Gateway log, perhaps by shadowing the device that holds it. If a new log has to be created, or an out-of-date log is used, transactions that were originally recorded as committed may be incorrectly rolled back. This can cause databases to become inconsistent with each other or inconsistent with reports given to other systems or users. In general, Gateway logs are not large and it is better never to delete them. Before deleting an unwanted Gateway log, use the DECdtm XGCP utility to check that the Gateway is not still a participant in any prepared transactions. The Gateway participant name is DDTM$XG/name. The Gateway server has the following parameters:
30.7.3.2 XA RM ConfigurationEach XA-compliant transaction manager (TM) defines its own method for including resource managers (RMs). Typically, a configuration file is edited and used as input to build application programs that run under the control of the TM. You may also need to configure and build a separate TM worker process that performs transaction prepare and commit operations. See the documentation for your XA TM for specific instructions. You will need the following information about the XA Gateway RM. This is published in the XA Specification (Section 7.2).
The Gateway is implemented by the shareable image SYS$LIBRARY:DDTM$XG.EXE.
You must install the privileged sharable image
SYS$LIBRARY:DDTM$XG_SS.EXE. It provides system services for internal
use by the Gateway and the XGCP utility.
You may find the following hints to be of help:
30.7.3.3 Implementation Characteristics
The following sections describe the implementation characteristics of
the XA Gateway.
The XA Gateway sets the DECdtm default transaction for each XA transaction.
Most DECdtm RMs join the default transaction if an explicit TID is not
specified on a call to the RM. If an RM does require an explicit TID,
the application can use the $GET_DEFAULT_TRANS system service to read
the current default TID.
DECdtm does not distinguish between loosely coupled and tightly coupled threads, as defined by the XA specification. Instead, each RM makes its own decision whether to allow transaction branches in different processes to share data. The Gateway allocates a separate DECdtm TID for each branch of an XA global transaction. This allows a branch to be prepared while other branches continue to perform work, as required by Section 2.2.6 of the XA specification. Consequently, DECdtm RMs enforce isolation between the branches of an XA global transaction. This behavior is consistent with the XA specification, but not required by it. When multiple processes perform work on a single branch within a single node of an OpenVMS Cluster, the gateway allocates a single DECdtm TID for the branch. In principle, this allows the RMs to recognize that work in multiple processes is part of a single transaction, and to use tightly coupled threads. However, it depends on the RM whether this is implemented.
The Gateway does not use the same TID for a single branch of a
transaction seen on multiple nodes of an OpenVMS Cluster. However, it
is unlikely that any XA TM will use the same branch on different nodes,
or that any DECdtm RM is capable of implementing tightly coupled
threads between nodes.
DECdtm RMs may choose to implement a read-only optimization when a
transaction is prepared (see Section 2.3.2 of the XA specification). If
all DECdtm RMs use the optimization for a given transaction, the
Gateway uses the same optimization on the xa_prepare call for the
transaction.
The Gateway is unable to determine if a blocking condition exists or
not. Consequently, it always returns XA_RETRY when the TMNOWAIT flag is
set.
The Gateway translates DECdtm reason codes to XA return codes as follows:
The Gateway uses XAER_RMFAIL to indicate a failure to access data on disk, while XAER_RMERR indicates an internal failure. It translates DECdtm error codes to XA return codes as follows:
An exception is xa_commit. This function returns XAER_RMFAIL instead of XA_RMERR, because the XA specification states that XA_RMERR indicated a catastrophic failure for this function.
|