ATMI COBOL Function Reference
TXSETCOMMITRET()
- set commit_return
characteristic
DATA DIVISION.
* Include TX definitions.
01TX-RETURN-STATUS
.
COPY TXSTATUS.
*
01TX-INFO-AREA
.
COPY TXINFDEF.
PROCEDURE DIVISION.
CALL "TXSETCOMMITRET" USINGTX-INFO-AREA TX-RETURN-STATUS
.
TXSETCOMMITRET()
sets the commit_return
characteristic to the value specified in COMMIT-RETURN
. This characteristic affects the way TXCOMMIT()
behaves with respect to returning control to its caller. TXSETCOMMITRET()
may be called regardless of whether its caller is in transaction mode. This setting remains in effect until changed by a subsequent call to TXSETCOMMITRET()
.
The initial setting for this characteristic is TX-COMMIT-COMPLETED
.
The following are the valid settings for COMMIT-RETURN
.
This flag indicates that TXCOMMIT()
should return after the commit decision has been logged by the first phase of the two-phase commit protocol but before the second phase has completed. This setting allows for faster response to the caller of TXCOMMIT()
. However, there is a risk that a transaction will have a heuristic outcome, in which case the caller will not find out about this situation via return codes from TXCOMMIT()
. Under normal conditions, participants that promise to commit during the first phase will do so during the second phase. In certain unusual circumstances however (for example, long-lasting network or node failures) phase 2 completion may not be possible and heuristic results may occur.
TX-RETURN-STATUS
is the record used to return a value.
Upon successful completion, TXSETCOMMITRET()
returns TX-OK
, a non-negative return value.
Under the following conditions, TXSETCOMMITRET()
does not change the setting of the commit_return
characteristic and returns one of these negative values:
The function was called in an improper context (for example, the caller has not yet called TXOPEN()
).
TXBEGIN(3cbl)
, TXCOMMIT(3cbl)
, TXINFORM(3cbl)
, TXOPEN(3cbl)
, TXROLLBACK(3cbl)