The following are the connection properties used in conjunction with Distributed Transaction support.
Distributed Transaction Protocol (DistributedTransactionProtocol) – To specify the protocol used to support the distributed transaction, XA Interface standard, or MS DTC OLE Native protocol, set up the property DistributedTransactionProtocol=OLE native protocol in the connection string. The default protocol is XA.
Tightly Coupled Transaction (TightlyCoupledTransaction) – When you have a distributed transaction using two resource managers that point to the same Adaptive Server server, you have a situation called a “Tightly Coupled Transaction.” Under these conditions, if you do not set this property to 1, the Distributed Transaction may fail.
To summarize, if you open two database connections to the same Adaptive Server server and enlist these connections in the same distributed transaction, you must set TightlyCoupledTransaction=1.
Enlist – The AseConnection object automatically enlists in an existing distributed transaction if it determines that a transaction is active. Automatic transaction enlistment occurs when the connection is opened or retrieved from the connection pool. You can disable this auto-enlistment by specifying Enlist=0 as a connection string parameter for an AseConnection.
If auto-enlistment is disabled, you can enlist in an existing distributed transaction by calling the EnlistDistributedTransaction method on the AseConnection with a passed-in ITransaction parameter that is a reference to an existing transaction. After calling the EnlistDistributedTransaction, all updates made using this instance of AseConnection will be made as part of this global transaction. As a result, it will be committed or rolled back when the global transaction is committed or rolled back.
The AseConnection object must be open before calling EnlistDistributedTransaction.
You can use EnlistDistributedTransaction when you pool business objects. If a business object is pooled with an open connection, automatic transaction enlistment occurs only when that connection is opened or pulled from the connection pool. If multiple transactions are performed using the pooled business object, the open connection for that object will not automatically enlist in newly initiated transactions. In this instance, you can disable automatic transaction enlistment for the AseConnection and then enlist the AseConnection in transactions using EnlistDistributedTransaction
WARNING! EnlistDistributedTransaction returns an exception if the AseConnection has already begun a transaction either by using BeginTransaction or by executing the BEGIN TRANSACTION statement explicitly with an AseCommand.