Connecting with Distributed Transactions
The with clause identifies a specific distributed transaction by its distributed transaction ID. When you include the with clause, the application is connected to the specified database and the local transaction associated with the specified distributed transaction. This option enables a coordinator application to re-establish a connection with an open transaction if the connection between the application and the local DBMS server is lost for any reason.
The distributed transaction is identified by its distributed transaction ID, an 8-byte integer generated by the application. In the with clause, the value associated with highdxid must be the high-order 4 bytes of this ID and the value associated with 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, either a commit or a rollback statement must immediately follow the connect statement. Commit commits the open local transaction; rollback aborts it. After the commit or rollback has been issued, the session can continue, issuing any valid statement. For more information about distributed transactions, see the SQL Reference Guide.
Last modified date: 08/14/2024