Home | Previous Page | Next Page   Distributed Data > Multiphase Commit Protocols > Two-Phase Commit Protocol >

When the Two-Phase Commit Protocol Is Used

A database server automatically uses the two-phase commit protocol for any transaction that modifies data on multiple database servers.

For example, suppose three database servers that have the names australia, italy, and france, are connected, as shown in Figure 83.

Figure 83. Connected Database Servers
begin figure description - This figure is described in the surrounding text. - end figure description

If you execute the commands shown in Figure 84, the result is one update and two inserts at three different database servers.

Figure 84. Example of a Distributed Transaction
CONNECT TO stores_demo@italy
BEGIN WORK
   UPDATE stores_demo:manufact SET manu_code = 'SHM' WHERE manu_name = 'Shimara'
   INSERT INTO stores_demo@france:manufact VALUES ('SHM', 'Shimara', '30')
   INSERT INTO stores_demo@australia:manufact VALUES ('SHM', 'Shimara', '30')
COMMIT WORK
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]