OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCTRN('C-ROLL ') - Enable rollback in chained 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 'C-ROLL  '.
    02  data-name-B    PIC X(5).

Description

CBLDCTRN('C-ROLL ') rolls back a transaction. A transaction is generated immediately after CBLDCTRN('C-ROLL ') is called.

By calling CBLDCTRN('C-ROLL '), rollback processing is reported from the root transaction branch of the global transaction to the UAPs, transaction services, and resource managers of transaction branches which form the transaction.

When CBLDCTRN('C-ROLL ') terminates normally, the process that called the program returns after rollback processing. Then, a new global transaction is started. The process that calls CBLDCTRN('C-ROLL ') is in the range of this transaction. However, this does not mean the specification of a transaction mode for a UAP other than the UAP that called this program.

CBLDCTRN('C-ROLL ') can be called only from the root transaction branch (the UAP that called CBLDCTRN('BEGIN ')) of a global transaction. If CBLDCTRN('C-ROLL ') is called from another UAP, the status code 00905 is returned.

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

Data area whose value is set in the UAP

data-name-A

Specify VALUE 'C-ROLL[Figure]' for the request code indicating rollback in chained mode. The contents remain unchanged for processing after the chained 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. Even after CBLDCTRN('C-ROLL ') terminates, this process is under the transaction and it is in the range of the global transaction.
00903 The global transaction that called CBLDCTRN('C-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.
Even after this code is returned, this process is under the transaction and it is 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.
Even after this code is returned, this process is under the transaction and it is in the range of the global transaction.
00905 CBLDCTRN('C-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.
00924 The rollback processing terminated normally, but the new transaction could not be started. After this code is returned, this process is no longer under the transaction.
00926 The global transaction that called CBLDCTRN('C-ROLL ') was determined heuristically. Consequently, a transaction branch was committed, and another transaction branch was rolled back. This error is returned if the result of heuristic decision do not match the results of the synchronization point of the global transaction. Refer to the contents of 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. The new transaction could not be started. After this code is returned, this process is no longer under transaction.
00927 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 contents of 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.
The new transaction could not be started. After this code is returned, this process is no longer under transaction.

Example

01 MISC.
    02 CMD-CODE     PIC X(8).
    02 STATUS-CODE  PIC X(5).
      :
      :
MOVE 'C-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.