Platform SDK: Transaction Server |
This method commits the transaction. The Commit method may only be called by the initiator of the transaction.
HRESULT Commit (
BOOL |
fRetaining, |
DWORD |
grfTC, |
DWORD |
grfRM) |
Parameters
fRetaining [in]
Must be FALSE.
grfTC [in]
Values taken from the enumeration XACTTC.
Flag | Meaning |
---|---|
XACTTC_ASYNC | When this flag is specified, an asynchronous commit is performed. This flag may not be specified when the XACTTC_SYNCPHASEONE flag is specified. |
XACTTC_SYNCPHASEONE | When this flag is specified, the call to Commit returns after phase one of the two-phase commit protocol. This flag may not be specified when the XACTTC_ASYNC flag is specified. |
grfRM [in]
Must be zero.
Return Values
S_OK
Success. Transaction was successfully committed.
XACT_S_ASYNC
An asynchronous commit was specified. The commit operation has begun but its outcome is not yet known. When the transaction completes, notification will be sent on the ITransactionOutcomeEvents interface.
XACT_E_NOTRANSACTION
Unable to commit the transaction because it had already been committed or aborted. This call was ignored.
XACT_E_ALREADYINPROGRESS
A commit or abort operation was already in progress. This call was ignored.
XACT_E_NOTSUPPORTED
An invalid combination of commit flags was specified. This call was ignored.
XACT_E_CANTRETAIN
Retaining commit is not supported. This call was ignored.
XACT_E_COMMITFAILED
The transaction failed to commit for an unknown reason. The transaction was aborted.
E_FAIL
The transaction failed to commit for an unknown reason. The transaction was aborted.
XACT_E_INDOUBT
The transaction status is in-doubt. A communication failure has occurred or a transaction manager or resource manager has failed.
E_UNEXPECTED
An unexpected error has occurred. The transaction status is unknown.
XACT_E_ABORTED
The transaction was aborted before Commit was called.
XACT_E_CONNECTION_DOWN
No longer able to communicate with the transaction manager because the connection to the transaction manager failed. The transaction was aborted.