TwoPhase: Two-Phase Commit Example

Click to open or copy the files for the TwoPhase sample.

This example uses the two-phase commit service to perform a simultaneous update on two servers. In this example, one of the servers participating in the distributed transaction also functions as the commit service.

In this particular example, the same update is performed on both servers. You can, however, use the commit server to perform completely different updates on each server.

Building SDK Samples

This sample uses the following keywords:

abort_xact; abortall; close_commit; commit_xact; dbcancel; dbcmd; dbdead; dberrhandle; dbexit; dblogin; dbmsghandle; dbsetlapp; dbsetlpwd; dbsetluser; dbsetlversion; dbsqlexec; dbuse; defined; err_handler; exit; msg_handler; printf; remove_xact; sprintf; start_xact; strcat