ITransactionJoin::JoinTransaction

Requests that the session enlist in a coordinated transaction.

HRESULT JoinTransaction (
   IUnknown *               punkTransactionCoord,
   ISOLEVEL               isoLevel,
   ULONG                  isoFlags,
   ITransactionOptions *   pOtherOptions);

Parameters

punkTransactionCoord

[in]
A pointer to the controlling IUnknown of the transaction coordinator, or NULL in order to unenlist from the coordinated transaction. If non-null, QueryInterface can be called for ITransaction on the transaction coordinator.

isoLevel

[in]
The isolation level to be used with this transaction. For more information, see ITransactionLocal::StartTransaction.

isoFlags

[in]
Must be zero.

pOtherOptions

[in]
Optionally a null pointer. If this is not a null pointer, then it is a pointer to an object previously returned from GetOptionsObject called on this session.

Return Code

S_OK
The method succeeded.

E_FAIL
An unknown error occurred.

E_INVALIDARG
punkTransactionCoord was a null pointer and the provider doesn’t support unenlisting from a coordinated transaction.

E_UNEXPECTED
An unknown provider-specific error occurred.

XACT_E_CONNECTION_DOWN
The connection to the transaction manager failed.

XACT_E_CONNECTION_REQUEST_DENIED
The transaction manager did not accept a connection request.

XACT_E_ISOLATIONLEVEL
Neither the requested isolation level, nor a strengthening of it, can be supported by this transaction implementation or isoLevel was not valid.

XACT_E_LOGFULL
Unable to begin a new transaction because the log file is full.

XACT_E_NOENLIST
A transaction coordinator was specified, but the new transaction was unable to enlist therein.

XACT_E_NOISORETAIN
The requested semantics of retention of isolation across retaining commit and abort boundaries cannot be supported by this transaction implementation or isoFlags was not equal to zero.

XACT_E_NOTIMEOUT
A time-out was specified, but time-outs are not supported.

XACT_E_TMNOTAVAILABLE
Unable to connect to the transaction manager or the transaction manager is unavailable.

XACT_E_XTIONEXISTS
The enlistment request failed for one of the following reasons:

Comments

The provider of the session will generally first register its ITransactionOutcomeEvents notification sink with the transaction coordinator, so that it can be notified of the outcome of the coordinated events, and will then enlist with the transaction coordinator using the interfaces defined in OLE Transactions. It is important that the provider first register with the outcome events so that it can be advised of any failures which may occur between enlistment registration of the outcome events.

See Also

ITransactionLocal::StartTransaction