DB2 Server for VSE: System Administration


Two-Phase Commit Processing

Distributed unit of work is a coordinated approach involving two phases. This coordination is done by a sync point manager. DB2 Server for VSE uses CICS/VSE as its sync point manager. A sync point manager maintains consistency in changes which are made to protected resources. The primary functions of a sync point manager include, but are not limited to, the following:

  1. Keeping track of and logging LUW state information
  2. Keeping track of and logging all local protected resource manager (PRM) names that are involved with a logical unit of work
  3. Coordinating the COMMIT and ROLLBACK of all local PRMs
  4. Initiating resynchronization protocols for any logical unit of work that may be in the in-doubt state because of a system or communications failure.

A sync point manager is required wherever resources may be updated. This requires that sync point managers at each distributed location communicate with one another using architected protocols. These protocols are fully discussed in the SNA LU 6.2 Reference: Peer Protocols manual.

For a full explanation of what two-phase commit is, see the following manuals:

Using the Two-Phase Commit Protocol

An example of a two-phase commit protocol sequence is shown in Figure 122. SNA LU 6.2 functions provide so many capabilities that it is impossible to show all the possible sequences. Notes describing key points in the sequence follow the sequence diagram.

The following assumptions have been made for the example:

For example:

Figure 122. Successful Two-Phase Commit

arip2stc

Figure Notes:

(1)
The Target Communications Manager (TCM) issues a RECEIVE_AND_WAIT APPC verb to receive the next SQL Request from the Source Server.

(2)
The source application program requests the SYNCPNTMGR to commit the logical unit of work (LUW). The source SYNCPNTMGR notifies the SNA LU 6.2 communications facilities to prepare to commit and notifies the source database (and other protected resource managers registered with the SYNCPNTMGR) to prepare to commit. The source communications facility sends the SNA LU 6.2 prepare message to the target system. The local protected resource managers respond to the source SYNCPNTMGR with the "Request Commit" message.

(3)
On the target system, the RECEIVE_AND_WAIT verb is completed and the WHAT_RECEIVED parameter is set to TAKE_SYNCPT.

The TCM issues a SYNCPT verb to the target SYNCPNTMGR which begins the commit processing. The SYNCPNTMGR prepares the protected resources to commit.

(4)
The SYNCPNTMGR sends the SNA LU 6.2 request commit message to the source system.

(5)
The source SYNCPNTMGR collects the request commit messages from the SNA LU 6.2 communications facilities and the other protected resource managers. The source SYNCPNTMGR then commits the logical unit of work by requesting that all of the resources commit. This causes an SNA LU 6.2 committed message to be sent to the target system.

(6)
The target SYNCPNTMGR requests that the local resources commit the logical unit of work and causes an SNA LU 6.2 forget message to be sent to the source system. In addition, the target SYNCPNTMGR posts a positive response to the TCM for the SYNCPT verb issued in note (3).

(7)
When the source SYNCPNTMGR receives the "FO" responses from the protected resource managers, a positive response to the commit is given to the application program.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]