OpenTP1 Version 7 Description

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

3.1.3 Commit and rollback operations

A transaction ends with success (with a commit operation performed on the transaction) or failure (with a rollback operation performed on the transaction). The decision of whether a transaction is to end in success or failure (i.e., whether to perform a commit or rollback operation) is called a transaction determination. OpenTP1 performs a transaction determination at a synchronization point. This point is at the boundary of two transactions: at the end of one and at the beginning of the next. Resources are updated at a synchronization point.

In a commit operation on a transaction, the transaction ends successfully with affected resources updated consistently. During the commit operation, the affected resources for all the transaction branches in a global transaction are updated.

In a rollback operation on a transaction, the transaction ends in failure with those resources that should have been updated by the transaction returned to the same status as at the beginning of the transaction. If a UAP detects data inconsistency or a failure before a synchronization point, rollback functions (e.g., dc_trn_unchained_ rollback() or dc_trn_chained_rollback()) can be issued to rollback the transaction and preserve the integrity of the data.

OpenTP1 can log the reason why the transaction rolled back. The operand trn_rollback_information_put in the transaction service definition allows you to specify whether or not to log the causes of transaction rollback.

OpenTP1 monitors the times for each transaction branch. If a transaction branch does not end in the allotted time, OpenTP1 rolls back the transaction. For details of time monitoring, see the manual OpenTP1 System Definition.

Figure 3-3 shows a rollback operation (indicated by the gray line) on a transaction.

Figure 3-3 Rollback operation on a transaction

[Figure]