If your data is distributed across multiple databases,
you may want to read and update several databases in a single transaction.
This type of database access is called a multisite update.
About this task
Figure 1. Updating multiple databases in a single
transaction
Figure 1 shows a database client
running a funds transfer application that accesses three database
servers: one containing the checking account, another containing the
savings account, and the third containing the banking fee schedule.
Procedure
To set up a funds transfer application for this environment,
you have two options:
Using the Db2® transaction manager (TM):
Create the necessary tables in the appropriate databases
If physically remote, set up the database servers to use the appropriate communications
protocols
If physically remote, catalog the nodes and the databases to identify the databases on the
database servers
Precompile your application program to specify a type 2 connection (that is, specify
CONNECT2 on the PRECOMPILE command), and two-phase commit (that is,
specify SYNCPOINTTWOPHASE on the PRECOMPILE command)
Configure the Db2 transaction
manager (TM).
Using an XA-compliant transaction manager:
Create the necessary tables in the appropriate databases
If physically remote, set up the database servers to
use the appropriate communications protocols
If physically remote, catalog the nodes and the databases
to identify the databases on the database servers
Precompile your application program to specify a type
2 connection (that is, specify CONNECT2 on
the PRECOMPILE command), and one-phase commit (that
is, specify SYNCPOINTONEPHASE on
the PRECOMPILE command)
Configure the XA-compliant transaction manager to use the Db2
databases.