OpenTP1 Version 7 Description

[Contents][Glossary][Index][Back][Next]

4.4.5 Accessing database management systems

This section describes how database management systems (DBMSs) can be used in OpenTP1 UAP.

Organization of this subsection
(1) Relation to OpenTP1 transaction processing
(2) Preparing to use XA-compliant databases

(1) Relation to OpenTP1 transaction processing

The usage of DBMSs depends on whether the DBMS supports the XA interface in the X/Open DTP model, and whether the DBMS can work with OpenTP1 transactions.

(a) DBMSs that support the XA interface

Only DBMSs that support the XA interface, for example ORACLE, can be controlled by OpenTP1 transaction processing. When a DBMS supports the XA interface, updates are possible using the commit and rollback operations of OpenTP1 transaction processing. In such transaction processing, you can use the functions that control OpenTP1 synchronization points (such as the functions dc_trn_begin(), dc_trn_unchained_commit(), tx_begin(), or tx_commit()).

Facilities provided by a DBMS for controlling transactions cannot be used.

In UAPs that access multiple databases, OpenTP1 allows updates while protecting the consistency of the multiple databases. The OpenTP1 resource managers (provided by the products TP1/FS/Direct Access, TP1/FS/Table Access, TP1/Message Control, TP1/Message Queue, and Hitachi ISAM and ISAM/B) support the XA interface. Thus, a UAP can process OpenTP1 transactions when accessing DBMSs that conform to the XA interface in the same way it does when it accesses the OpenTP1 resource manager. Even when some failure cause an abnormal termination of a UAP or when OpenTP1 is restarted, OpenTP1 performs a transaction determination (i.e., decides whether to perform a commit or rollback) for both the DBMS and the OpenTP1 resource manager.

(b) DBMSs that do not support the XA interface, or DBMSs that do not work with OpenTP1 via the XA interface

A DBMS that does not support the XA interface can be accessed, but cannot be synchronized with OpenTP1 transactions.

When a DBMS does not work with OpenTP1 via the XA interface, OpenTP1 cannot order a transaction determination to the DBMS in certain situations: such as when a UAP abnormally terminates during access to a database, or when OpenTP1 requires a complete-recovery restart during access to a database. In such situations, you must recover the transactions using the DBMS facilities.

(2) Preparing to use XA-compliant databases

The following tasks are required when DBMSs that support the XA interface cooperate with OpenTP1 via the XA interface:

(a) Registering the DBMS in OpenTP1

Register several names for resource managers other than those provided by OpenTP1. Use either of these methods to register them in OpenTP1:

When an extended RM registration definition is created, the trnlnkrm command does not need to be executed after setting up OpenTP1 with the dcsetup command. For details on how to use the trnlnkrm command, see the manual OpenTP1 Operation. For details on how to specify the extended RM registration definition, see the manual OpenTP1 System Definition.

(b) Linking

To create executable files for a UAP, you must link the object files used for transaction control with the DBMS libraries and object modules.

Use the trnmkobj command to make object files used for transaction control. For details on the trnmkobj command, see the manual OpenTP1 Operation.

(c) Writing system definitions

To use DBMSs, you must use trnstring in the transaction service definition and, if necessary, use trnrmid in the user service definition or user service default definition. Specified contents include the items for DBMSs. For details on such items, see the appropriate manuals for the database you use.

For details on definitions using trnstring and trnrmid, see the manual OpenTP1 System Definition.

(d) Setting environment variables

Some DBMS may require special environment variables for use with OpenTP1 UAPs. If they are necessary, you must use putenv in the transaction service definition, user service definition, or user service default definition.

For details on definitions using putenv, see the manual Open TP1 System Definition.

(e) Extending the OpenTP1 internal thread stack area

To use DBMSs, in the thread_stack_size operand in the transaction service definition, you must specify the size of the thread stack area to be used by OpenTP1 internally.

For details on definitions, see the manual OpenTP1 System Definition.