OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/J

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

2.3.2 Synchronization point acquisition

Organization of this subsection
(1) Commit
(2) Rollback
(3) Handling of heuristic situations
(4) Processing time of transactions
(5) Types of statistical information to be acquired for transaction branches

(1) Commit

When a transaction terminates normally, a synchronization point (commit) is acquired by calling a commit request method from the CUP. The global transaction terminates normally when all of its transaction branches terminate normally.

(a) Commit in chained and unchained modes

The two modes of synchronization point acquisition for transaction processing are the commit in chained mode, in which a synchronization point is acquired after a transaction ends and then the next transaction is started immediately, and the commit in unchained mode, in which no new transaction is started after a synchronization point is acquired at the end of a transaction.

To request a commit in the chained mode, call the trnChainedCommit method.

To request a commit in the unchained mode, call the trnUnchainedCommit method.

The following figure shows the chained and unchained modes of transactions.

Figure 2-12 Chained and unchained modes of transactions

[Figure]

(b) Processing when no commit request method is called

If a CUP terminates without calling a commit request method or a CUP terminates abnormally before calling a commit request method, the corresponding transaction is rolled back.

(2) Rollback

(a) When TP1/Server processing results in an error

If an error occurs in a transaction, the commit request method is returned with an error. The corresponding transaction is rolled back for partial recovery. If an error occurs on one of the transaction branches of a global transaction, the entire global transaction becomes subject to rollback. In such a case, TP1/Server executes partial recovery to roll back the transaction branches.

The following figure shows rollback of a transaction when an error occurs in TP1/Server processing.

Figure 2-13 Rollback of a transaction (when an error occurs in TP1/Server processing)

[Figure]

(b) Calling a rollback request method

To roll back a transaction based on a determination by the CUP, call a rollback request method from the CUP.

The two modes of rollback are rollback in chained mode and rollback in unchained mode.

To request a rollback in the chained mode, call the trnChainedRollback method. A CUP process that has called the trnChainedRollback method for rollback remains in the global transaction range.

To request a rollback in the unchained mode, call the trnUnchainedRollback method. A CUP process that has called the trnUnchainedRollback method is placed outside the global transaction range after the rollback processing.

The following figure shows rollback of a transaction when a rollback request method is called.

Figure 2-14 Rollback of a transaction (when a rollback request method is called)

[Figure]

(3) Handling of heuristic situations

If a heuristic situation occurs during transaction processing, an error is returned during CUP synchronization point acquisition. The exceptions are as follows:

For details about the causes of these exceptions and the synchronization point result for the global transaction, see the TP1/Server's message log file.

For details about how to handle heuristic situations, see the manual OpenTP1 Programming Guide.

(4) Processing time of transactions

You can specify the following transaction-related times in the TP1/Client/J environment definition; for details, see 5.2 Details of TP1/Client/J environment definitions:

(5) Types of statistical information to be acquired for transaction branches

You can specify in the TP1/Client/J environment definition the types of transaction statistical information that are to be acquired for each transaction branch. For details, see 5.2 Details of TP1/Client/J environment definitions.