Transaction Options

Transaction options objects, are used to associate attributes with transactions. The application calls ITransactionDispenser::GetOptionsObject to create a transaction options object. The application then assigns transaction attributes to the transaction options object by calling the ITransactionOptions::SetOptions method. The transaction options object can then be passed as an argument to ITransactionDispenser::BeginTransaction. The transaction attributes from the transaction options object will be inherited by the newly created transaction object.

A transaction options object can provide a textual description for a transaction. The description is displayed in the SQL Enterprise Manager MS DTC Transactions window (see Chapter 3, "Administration"). The description is for the MS DTC system administrator only; it is not processed or interpreted by MS DTC.

Transaction options objects also can specify a time-out value (in milliseconds) for a given transaction.

The time-out value limits the duration of the transaction and therefore bounds the amount of time locks are held on database records and system resources. If the time-out period expires before the transaction commits, MS DTC automatically aborts the transaction. A time-out value of zero specifies an infinite time-out period and places no limit on how long database resources can be locked.

For more information about transaction options, see ITransactionOptions.