Example 14: Two-phase commit

The two-phase commit sample program, 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 sample, you can use isql on each of the servers to determine whether the update actually took place.

This sample requires that you have Adaptive Server running on two different servers, named SERVICE and PRACTICE, each containing the pubs2 database. If your servers are named differently, replace SERVICE and PRACTICE in the source code with the actual names of your servers.

Before running the sample, you need to make sure that your client can access both servers. Refer to the Open Client Configuration Guide for Mac OS X for information about connecting to multiple instances of Adaptive Server.

NoteIf the PRACTICE server is on a different machine than the SERVICE server, the PRACTICE server must be able to connect to the SERVICE query port. For details, see the Open Client Configuration Guide for Mac OS X.