ALLBASE/SQL Reference Manual (36216-90216)

104 Chapter2
Using ALLBASE/SQL
Using Multiple Connections and Transactions with Timeouts
4. End the transaction that was initiated for the Parts1 connection and terminate the
connection.
COMMIT WORK
DISCONNECT 'Parts1'
5. Set the current connection to 'Sales1'.
SET CONNECTION 'Sales1'
6. Begin transaction for SalesDBE.
BEGIN WORK RC
.
.
.
7. Set the current connection to Accounting1.
SET CONNECTION 'Accounting1'
8. Begin transaction for Accounting1.
BEGIN WORK RC
.
.
.
9. End both open transactions and disconnect the two active connections. Note that the
COMMIT WORK statement is issued for the current connection's transaction.
COMMIT WORK
SET CONNECTION 'Sales1'
COMMIT WORK
DISCONNECT ALL
Note that following the execution of a DISCONNECT CURRENT statement, no current
connection exists. To establish a current connection following a DISCONNECT CURRENT
statement, you must either establish a connection or set the connection.