Compartilhar via


ITransactionDispenser::BeginTransaction

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

This method initiates a new transaction and returns a new transaction object which represents the transaction.

Syntax

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

Parameters

punkOuter
[in] Must be NULL.

isoLevel
[in] The isolation level to be used for this transaction, specified by the ISOLATIONLEVEL enumeration. This value is ignored by DTC and passed on to the resource managers.

isoFlags
[in] Values from ISOFLAG enumeration.

pOptions
[in] A pointer to a transaction options object. This value may be NULL. If pOptions is NULL the time-out value for the transaction is infinite and the transaction will not have a description.

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

Return Values

S_OK
Success.

CLASS_E_NOAGGREGATION
punkOuter was not NULL.

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

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

E_OUTOFMEMORY
Unable to allocate memory.

E_FAIL
An unknown error occurred.

E_UNEXPECTED
An unknown error occurred.

E_INVALIDARG
ppTransaction was NULL.

XACT_E_CONNECTION_DOWN
No longer able to communicate with the transaction manager because the connection to the transaction manager failed.

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

XACT_E_CONNECTION_DENIED
The transaction manager refused to accept a connection.

Remarks

A transaction options object which is passed as a parameter to BeginTransaction must not be altered while the BeginTransaction method invocation is outstanding.

Requirements

For an explanation of the requirement values, see Requirements (Component Services).

Platforms: Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista

Header: Declared in transact.h

See Also

ITransactionOptions