Two-phase commit sample program

This example, twophase.c, performs a simple update on two different servers. See the source code for the exact contents of the update. After you have run the example, you can use isql on each of the servers to determine whether the update actually took place.

This example assumes that you have two Adaptive Servers running, named “SERVICE” and “PRACTICE,” each containing the pubs2 database. If your servers have different names, replace “SERVICE” and “PRACTICE” in the source code with the actual names of your servers.

Before running the example, make sure that your interfaces file includes appropriate entries for both servers. See the Open Client DB-Library/C Reference Manual and the Open Client and Open Server Configuration Guide for Microsoft Windows for information about the interfaces file.

If the “PRACTICE” server is on a different machine from the “SERVICE” server, the interfaces file on that machine must also contain an entry for the “SERVICE” query port. For details, see the Open Client DB-Library/C Reference Manual.