Skip navigation.

ATMI COBOL Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


TXOPEN(3cbl)

Name

TXOPEN() - open a set of resource managers

Synopsis

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 resource manager-specific information in a transaction manager-specific manner 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 resource manager-specific "open" calls 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() returns TX-ERROR, then no resource managers are open. If TXOPEN() returns TX-OK, some or all of the resource managers have been opened. Resource managers that are not open will return resource manager-specific errors when accessed by the application. TXOPEN() must successfully return before a thread of control participates in global transactions.

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

TX-RETURN-STATUS is the record used to return a value.

Return Value

Upon successful completion, TXOPEN() returns TX-OK, a non-negative return value.

Errors

Under the following conditions, TXOPEN() fails and returns 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. The exact nature of the error is written to a log file.

[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. The exact nature of the error is written to a log file.

See Also

TXCLOSE(3cbl)

 

Skip navigation bar  Back to Top Previous Next