OpenTP1 Version 7 Programming Reference COBOL Language

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

TXOPEN - Open a set of resource managers

Format

DATA DIVISION.
*  Include TX definitions.
 01  TX-RETURN-STATUS.
     COPY  TXSTATUS.
 
 PROCEDURE DIVISION.
 CALL "TXOPEN" USING TX-RETURN-STATUS.

Description

TXOPEN opens a set of resource managers in a portable manner. It invokes a transaction manager to read information specific to the resource manager in a manner specific to the transaction manager and pass this information to the resource managers linked to the caller.

TXOPEN attempts to open all resource managers that have been linked with the application. This function is used in place of open calls specific to the resource manager and allows an application program to be free of calls, which may hinder portability. Since resource managers differ in their initialization semantics, the specific information needed to open a particular resource manager must be published by each resource manager.

If TXOPEN sets TX-ERROR, no resource managers are open. If TXOPEN sets TX-OK, some or all of the resource managers have been opened. Resource managers that are not open return errors specific to the resource manager when accessed by the application. TXOPEN must successfully return before a thread of control participates in global transactions.

Once TXOPEN sets success, subsequent calls to TXOPEN (before an intervening call to TXCLOSE) are allowed. However, such subsequent calls return success, and the TM does not attempt to reopen any RMs.

<<Data areas>>

<<TX-RETURN-STATUS

The results of TXOPEN execution are returned to this area.>>

Return value

Upon successful completion, TXOPEN sets TX-OK, a non-negative return value. <<0 is returned.>> <<The set of one or more resource managers linked to the TXOPEN caller is opened.>>

Errors

Under the following conditions, TXOPEN fails and sets one of these negative values:

TX-ERROR
Either the transaction manager or one or more of the resource managers encountered a transient error. No resource managers are open.

TX-FAIL
Either the transaction manager or one or more of the resource managers encountered a fatal error. The nature of the error is such that the transaction manager and/or one or more of the resource managers can no longer perform work on behalf of the application.
Alternatively, an error occurred in the transaction manager because the execution environment was in non-journal operation mode.

See also

TXCLOSE.

<<Notes on use with OpenTP1>>

  1. <<Processes which create a transaction using TXBEGIN must have activated UAP executable files which are correctly linked according to the description in this manual.>>