ITransactionOptions::SetOptions

The SetOptions method is used to alter transaction attributes in a transaction options object.

HRESULT SetOptions(
XACTOPT *
pOptions)

Parameters

pOptions [in]
Pointer to the XACTOPT structure. This structure contains attribute information for a transaction options object.

typedef struct XACTOPT {
ULONG         ulTimeout;
unsigned char szDescription[ MAX_TRAN_DESC ];
} XACTOPT;
Element Description
ulTimeout The time-out 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.

The time-out is specified in milliseconds. A time-out value of zero indicates an infinite time-out.

szDescription szDescription provide a textual description for a transaction. The description is displayed by the MS DTC administration tool in the MS DTC Transactions window. The description is only meaningful to the MS DTC administrator and is not processed or interpreted by MS DTC itself. The string cannot be longer than MAX_TRAN_DESC bytes in length.

Return Values

S_OK
Success.

E_OUTOFMEMORY
Unable to allocate memory.

E_INVALIDARG
The value of pOptions is NULL.

Comments

SetOptions must not be invoked on a transaction options object which is currently in use by the ITransactionDispenser::BeginTransaction method.