SQL Reference Guide > SQL Reference Guide > SQL Statements > CONNECT > Connecting with Distributed Transactions
Was this helpful?
Connecting with Distributed Transactions
To connect to a specified database and the local transaction associated with a distributed transaction, include the WITH clause. In a two-phase commit application, this option allows a coordinator application to re-establish a connection that was unintentionally severed due to software or hardware problems.
The distributed transaction is identified by its distributed transaction ID, an 8-byte integer that is specified by the application. In the WITH clause, the value specified for highdxid must be the high-order 4 bytes of this ID and the value specified for lowdxid must be the low-order 4 bytes of the distributed transaction ID. The distributed transaction ID must have been previously specified in a PREPARE TO COMMIT statement.
When the program issues a CONNECT statement that includes the WITH clause, a COMMIT or a ROLLBACK statement must immediately follow the CONNECT statement. Commit commits the open local transaction, and rollback aborts it. For more information about distributed transactions, see the chapter “Working with Transactions and Handling Errors.”
Last modified date: 08/28/2024