OpenTP1 Version 7 Programming Reference C Language

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

dc_trn_unchained_rollback - Enable rollback in unchained mode

Format

ANSI C, C++

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

K&R C

#include <dctrn.h>
int  dc_trn_unchained_rollback()

Description

The function dc_trn_unchained_rollback() rolls back a transaction. If a transaction is rolled back in unchained mode, the transaction does not start contiguously.

Calling the function dc_trn_unchained_rollback() notifies a transaction branch, transaction service, and resource manager of a rollback.

The function dc_trn_unchained_rollback() can be called from any transaction branch of a global transaction. If the function dc_trn_unchained_rollback() is called from the root transaction branch, a new transaction does not start after the function dc_trn_unchained_rollback() returns normally.

If the function dc_trn_unchained_rollback() is called from a transaction branch other than the root transaction branch, the function dc_trn_unchained_rollback() puts the transaction branch into rollback_only state. In this case, the transaction branch that called the function dc_trn_unchained_rollback() is in the range of the transaction until synchronization point processing of the root transaction branch is completed.

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_unchained_rollback(). To have the service which calls the function dc_trn_unchained_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. If the function dc_trn_unchained_rollback() 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 the function dc_trn_unchained_rollback() is called from a transaction branch other than the root transaction branch, this process is put into rollback_only state.
DCTRNER_HEURISTIC -903 The global transaction that called the function dc_trn_unchained_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.
After this value is returned, this process is not under the transaction and it is not 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.
After this value is returned, this process is not under the transaction and it is not in the range of the global transaction.
DCTRNER_PROTO -905 The function dc_trn_unchained_rollback() was called from an invalid context (e.g., already not in the transaction). The transaction mode is not affected.

Example

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