ITransactionDispenser::BeginTransaction

Initiates a new transaction and returns a new transaction object that represents the transaction.

Syntax

HRESULT BeginTransaction (
IUnknown punkOuter,
ISOLEVEL isoLevel,
ULONG isoFlags,
ITransactionOptions* pOptions,
ITransaction** ppTransaction )

where

punkOuter
[in] Is NULL.
isoLevel
[in] Is the isolation level that is used for this transaction. This value is ignored by MS DTC and passed to the resource managers.
isoFlags
[in] Is zero.
pOptions
[in] Is a pointer to a transaction options object. This value can be NULL.

If pOptions is NULL the time-out value for the transaction is infinite and the transaction will not have a description.

The transaction options object must not be changed while the ITransactionDispenser::BeginTransaction method call is outstanding.

ppTransaction
[out] Is a pointer to the pointer to the ITransaction interface on the new transaction object.

Returns

S_OK
Indicates succeeded.
CLASS_E_NOAGGREGATION
Indicates punkOuter was not NULL.
XACT_E_LOGFULL
Indicates unable to begin a new transaction because the log file is full.
XACT_E_NOTIMEOUT
Indicates a time out was specified, but time outs are not supported.
E_OUTOFMEMORY
Indicates unable to allocate memory.
E_FAIL
Indicates an unknown error occurred.
E_UNEXPECTED
Indicates an unexpected error has occurred.
E_INVALIDARG
Indicates ppTransaction was NULL.
XACT_E_CONNECTION_DOWN
Indicates no longer able to communicate with the transaction manager, because the connection to the transaction manager failed.
XACT_E_TMNOTAVAILABLE
Indicates unable to connect to the transaction manager, or the transaction manager is unavailable.
XACT_E_CONNECTION_DENIED
Indicates the transaction manager did not accept a connection request.