OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P

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

2.4.2 Acquiring a synchronous point

Organization of this subsection
(1) Commit
(2) Rollback
(3) Disposal in case of heuristic situation
(4) Transaction processing times
(5) Collection type for statistics of transaction branch

(1) Commit

Synchronous point acquisition (commit) at the normal transaction termination is activated by the issuance of commit request functions. The global transaction is normally terminated when all transaction branches terminate normally.

(a) Commit in chained/unchained mode

There are two modes where a synchronous point is acquired in transaction processing. In chained mode, one transaction terminates, followed by startup of another transaction at an acquired synchronous point. In unchained mode, one transaction terminates and a synchronous point is acquired but no new transaction takes place.

A commit in chained mode is called by the dc_trn_chained_commit_s function. A commit in unchained mode is called by the dc_trn_unchained_commit_s function.

The following figure shows transactions in chained and unchained modes.

Figure 2-10 Transactions in chained and unchained modes

[Figure]

(b) Processing where no commit request function is issued

If either of the following occurs, the transaction is rolled back:

(2) Rollback

(a) Transaction errors in OpenTP1 processing

If an error occurs in a transaction, the commit request function is returned with an error and the transaction is rolled back for partial recovery. If an error occurs in any transaction branch of a global transaction, the entire global transaction is rolled back. Assuming that the transaction branch is to be rolled back, OpenTP1 executes partial recovery processing.

The following figure shows a transaction that is rolled back when an error occurs in OpenTP1 processing.

Figure 2-11 Rollback of transaction (when an error occurs in OpenTP1 processing)

[Figure]

(b) Issuing a rollback request function

To roll back a transaction at CUP's discretion, issue a rollback request function from the CUP.

There are two modes of rollback: rollback in chained mode and rollback in unchained mode.

A rollback in chained mode is requested by issuing the dc_trn_chained_rollback_s function. In this rollback, the process of the CUP that issued the function remains in the global transaction after the rollback processing.

A rollback in unchained mode is requested by issuing the dc_trn_unchained_rollback_s function. In this rollback, the process that issued the function comes out of the global transaction after the rollback processing.

The following figure shows a transaction that is rolled back by a rollback request function.

Figure 2-12 Rollback of transaction (when a rollback request function is issued)

[Figure]

(3) Disposal in case of heuristic situation

If a heuristic situation occurs in transaction processing, an error return takes place when the CUP acquires a synchronous point. The return values are:

For the cause of sending back these return values and the result of the synchronous point of a global transaction, see the message log file.

For details of the disposal to be taken in the case of a heuristic situation, see the manual OpenTP1 Programming Guide.

(4) Transaction processing times

The following times regarding transactions can be specified by the client environment definition. For details, see Section 7.2 Definition details.

(5) Collection type for statistics of transaction branch

The client environment definition can specify the collection type for the statistics of a transaction branch. For details, see Section 7.2 Definition details.