Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

11.1.5 SQL connection and transaction control

Unlike transaction control that does not use a distributed database, when a distributed database is used in transaction control, execution of a DISCONNECT statement with RD-node specification must be added when the transaction is being terminated. When the DISCONNECT statement with RD-node specification is executed, the current transaction is terminated normally and a synchronization point is set.

By omitting the COMMIT statement and using the DISCONNECT statement with RDnode specification to terminate a transaction normally, the number of communication contacts with the default RD-node can be reduced from the number required in the case in which the COMMIT statement is used for transaction termination.

Figure 11-2 shows examples of transaction startup and termination using an SQL connection to a distributed RD-node.

Figure 11-2 Examples of transaction startup and termination using an SQL connection to a distributed RD-node

[Figure]

If the UAP is terminated without issuing a DISCONNECT statement without RD-node specification, the transaction that was being executed is rolled back. In this case, all changes made by the transaction are cancelled, even if the database of the distributed RD-node was changed by the transaction that was executing.

Because there can be only one SQL connection to a distributed RD-node at a time, only one distributed RD-node can be accessed within a single transaction. However, two RD-nodes can be accessed within a single transaction if the default RD-node is included.

By issuing the SET CONNECTION statement to switch the current SQL connection, the default SQL connection and the SQL connection to a distributed RD-node can be used alternately within a single transaction.

A DISCONNECT statement with RD-node specification cannot be used in X/Open application programs that execute in the OLTP environment.