OpenTP1 Version 7 Programming Reference C Language

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

dc_trn_chained_rollback - Enable rollback in chained mode

Format

ANSI C, C++

#include <dctrn.h>
int  dc_trn_chained_rollback (void)

K&R C

#include <dctrn.h>
int  dc_trn_chained_rollback()

Description

The function dc_trn_chained_rollback() rolls back a transaction. A transaction is started immediately after the function dc_trn_chained_rollback() is called.

To call the function dc_trn_chained_rollback(), 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 the function dc_trn_chained_rollback() terminates normally, the process that called the function returns after rollback processing. Then, a new global transaction is started. The process that calls the function 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 function.

The function dc_trn_chained_rollback() can be called only from the root transaction branch (the UAP that called the function dc_trn_begin()) of a global transaction. If the function dc_trn_chained_rollback() is called from another UAP, DCTRNER_PROTO is returned.

Only the process that started the UAP which is created correctly according to the specification in this manual is permitted to call the function dc_trn_chained_rollback().

The function dc_trn_chained_rollback() can terminate either normally or abnormally when synchronization point processing is completed. To have the service which calls the function dc_trn_chained_rollback() terminated normally, specify the transaction attribute at UAP execution environment setup.

Return values

Return value Return value (numeric) Explanation
DC_OK 0 Normal termination. Even after the function dc_trn_chained_rollback() terminates, this process is under the transaction and it is in the range of the global transaction.
DCTRNER_HEURISTIC -903 The global transaction that called the function dc_trn_chained_rollback() was determined heuristically. Consequently, a transaction branch was committed, and another transaction branch was rolled back.
This value 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 value to be returned.
Even after this value is returned, this process is under the transaction and it is in the range of the global transaction.
DCTRNER_HAZARD -904 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 value to be returned.
Even after this value is returned, this process is under the transaction and it is in the range of the global transaction.
DCTRNER_PROTO -905 The function dc_trn_chained_rollback() was called from an invalid context (e.g., already not in the transaction). The transaction mode is not affected.
DCTRNER_NO_BEGIN -924 Although the rollback processing terminated normally, the new transaction could not be started. After this value is returned, this process is not under the transaction.
DCTRNER_HEURISTIC_NO_BEGIN -926 The global transaction that called the function dc_trn_chained_rollback() was determined heuristically.
Consequently, a transaction branch was committed, and another transaction branch was rolled back. This value is returned if the results of heuristic decision do not match the results of the synchronization point of the global transaction.
See to the message log file for the results of the synchronization point of the UAP, resource manager, or global transaction that caused this value to be returned.
The new transaction could not be started. After this value is returned, this process is not under the transaction.
DCTRNER_HAZARD_NO_BEGIN -927 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.
See to the message log file for the results of the synchronization point of the UAP, resource manager, or global transaction that caused this value to be returned.
The new transaction could not be started. After this value is returned, this process is not under the transaction.

Example

if (dc_trn_info (NULL) && dc_trn_chained_rollback () <0)
  fputs("cannot rollback transaction\n", stderr);

Note

This API does not obtain a UAP trace.