OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCTRN('U-ROLL ') - Enable rollback in unchained mode

Format

PROCEDURE DIVISION specification

CALL  'CBLDCTRN'  USING  unique-name-1

DATA DIVISION specification

01  unique-name-1.
    02  data-name-A    PIC X(8) VALUE 'U-ROLL  '.
    02  data-name-B    PIC X(5).

Description

CBLDCTRN('U-ROLL ') rolls back a transaction. After CBLDCTRN('U-ROLL ') terminates normally, a new global transaction is not generated.

CBLDCTRN('U-ROLL ') can be called from any transaction branch of a global transaction. If CBLDCTRN('U-ROLL ') is called from the root transaction branch, a new transaction is not started after CBLDCTRN('U-ROLL ') returns. If CBLDCTRN('U-ROLL ') is called from a transaction branch other than the root transaction branch, CBLDCTRN('U-ROLL ') puts the transaction branch into rollback_only state and returns to the client UAP. In this case, the transaction branch is in the range of the global transaction until the synchronization point processing of the root transaction branch is completed.

Only the process that started the UAP executable file correctly linked according to the specification in this manual is permitted to call CBLDCTRN('U-ROLL '). To terminate CBLDCTRN('U-ROLL ') normally, specify the transaction attribute at UAP execution environment setup.

Data area whose value is set in the UAP

data-name-A

Specify VALUE 'U-ROLL[Figure]' for the request code indicating rollback in unchained mode. The contents remain unchanged for processing after the unchained mode rollback is executed.

Data area whose value is returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

Status codes

Status code Explanation
00000 Normal termination. If CBLDCTRN('U-ROLL ') is called from the root transaction branch, this process is not under the transaction and it is not in the range of the global transaction. If CBLDCTRN('U-ROLL ') is called from a transaction branch other than the root transaction branch, this process is put into rollback_only state.
00903 The global transaction that called CBLDCTRN('U-ROLL ') was determined heuristically. Consequently, a transaction branch was committed, and another transaction branch was rolled back.
This code is returned if the results of heuristic decision do not match the results of the synchronization point of the global transaction.
Refer to the message log file for the results of the synchronization point of the UAP, resource manager, or global transaction that caused this code to be returned.
After this code is returned, this process is not under the transaction and it is not in the range of the global transaction.
00904 A transaction branch of the global transaction was completed heuristically. However, the results of the synchronization point of the heuristically completed transaction branch are not known due to an error.
Refer to the message log file for the results of the synchronization point of the UAP, resource manager, or global transaction that caused this code to be returned.
After this code is returned, this process is not under the transaction and it is not in the range of the global transaction.
00905 CBLDCTRN('U-ROLL ') was called from an invalid context (e.g., already not in the transaction). The transaction mode is not affected.
00908 The request code is invalid.

Example

01 MISC.
    02 CMD-CODE     PIC X(8).
    02 STATUS-CODE  PIC X(5).
       :
       :
MOVE 'U-ROLL  ' TO CMD-CODE OF MISC.
CALL 'CBLDCTRN' USING MISC.
IF STATUS-CODE OF MISC NOT EQUAL TO '00000' THEN
    MOVE 'CANNOT ROLLBACK TRANSACTION' TO ERRMSG OF
                                           OUT-ERROR-REC
    WRITE OUT-ERROR-REC
END IF.