TXBEGIN-begin a global transaction
01 TX-RETURN-STATUS.
COPY TXSTATUS.
CALL "TXBEGIN" USING TX-RETURN-STATUS.
TXBEGIN is used to place the calling thread of control in transaction mode. The calling thread must first ensure that its linked resource managers have been opened (via TXOPEN()) before it can start transactions. TXBEGIN fails (with a TX-STATUS value of [TX-PROTOCOL-ERROR]) if the caller is already in transaction mode or TXOPEN has not been called.
Once in transaction mode, the calling thread must call TXCOMMIT() or TXROLLBACK() to complete its current transaction. There are certain cases related to transaction chaining where TXBEGIN does not need to be called explicitly to start a transaction. See TXCOMMIT and TXROLLBACK for details. TX-RETURN-STATUS is the record used to return a value.
TXSETTIMEOUT()
Upon successful completion, TXBEGIN returns TX-OK, a non-negative return value.
Under the following conditions, TXBEGIN fails and returns one of these negative values:
TX-OUTSIDE]
TX-PROTOCOL-ERROR]
TX-ERROR]
TX-FAIL]
TXCOMMIT(), TXOPEN(), TXROLLBACK(), TXSETTIMEOUT()
XA-compliant resource managers must be successfully opened to be included in the global transaction. (See TXOPEN for details.)