OpenTP1 Version 7 Programming Reference COBOL Language

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

TXINFORM - Return global transaction information

Format

  DATA DIVISION.
*   Include TX definitions.
  01 TX-RETURN-STATUS.
     COPY  TXSTATUS.
*
  01 TX-INFO-AREA.
     COPY  TXINFDEF.
 
  PROCEDURE DIVISION.
  CALL "TXINFORM" USING TX-INFO-AREA TX-RETURN-STATUS.

Description

TXINFORM sets global transaction information in TX-INFO-AREA. In addition, this function sets a value indicating whether the caller is currently in transaction mode or not.

<<Data areas>>

<<TX-INFO-AREA>>

TXINFORM populates the TX-INFO-AREA record with global transaction information. The contents of the TX-INFO-AREA record are described under TXINTRO.

If TXINFORM is called in transaction mode, TRANSACTION-MODE is set to TX-IN-TRAN, XID-REC is populated with a current transaction branch identifier and TRANSACTION-STATE contains the state of the current transaction. If the caller is not in transaction mode, TRANSACTION-MODE is set to TX-NOT-IN-TRAN and XID-REC is populated with the null XID (see TXINTRO for details). In addition, regardless of whether the caller is in transaction mode, COMMIT-RETURN, TRANSACTION-CONTROL, and TRANSACTION-TIMEOUT contain the current settings of the commit_return and transaction_control characteristics, and the transaction timeout value in seconds.

The transaction timeout value returned reflects the setting to be used when the next transaction is started. Thus, it may not reflect the timeout value for the caller's current global transaction since calls made to TSXETTIMEOUT after the current transaction was begun may have changed its value.

<<TX-RETURN-STATUS

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

Return value

If the TXINFORM caller is in transaction mode, 1 is returned. If the TXINFORM caller is not in transaction mode, 0 is returned.

Errors

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

TX-PROTOCOL-ERROR
The function was called in an improper context (for example, the caller has not yet called TXOPEN).

TX-FAIL
The transaction manager encountered a fatal error. The nature of the error is such that the transaction manager can no longer perform work on behalf of the application.

Application usage

Within the same global transaction, subsequent calls to TXINFORM are guaranteed to provide an XID with the same gtrid component, but not necessarily the same bqual component.

See also

TXOPEN, TXSETCOMMITRET, TXSETTRANCTL, TXSETTIMEOUT.