ITransaction::Abort

Aborts the transaction. You can call ITransaction::Abort on a transaction repeatedly. XACT_S_ABORTING will be returned on each call following the first call to Abort.

Syntax

HRESULT Abort (
BOID* pboidReason,
BOOL fRetaining,
BOOL fAsync )

where

pboidReason
[in] Is an optional BOID that indicates why the transaction is being aborted. Must be NULL.
fRetaining
[in] Is FALSE.
fAsync
[in] Is TRUE or FALSE. When fAsync is TRUE, an asynchronous abort is performed and the call to ITransaction::Abort returns immediately. The application can use the ITransactionOutcomeEvents interface to receive notice that the transaction abort is underway. The ITransactionOutcomeEvents interface is described later in this chapter.

By default, fAsync is FALSE.

Returns

S_OK
Indicates succeeded.
XACT_S_ASYNC
Indicates that an asynchronous Abort was specified and the call to ITransaction::Abort returned immediately. The application can use the ITransactionOutcomeEvents interface to receive notice that the transaction abort is underway. The ITransactionOutcomeEvents interface is described later in this chapter.
XACT_E_NOTRANSACTION
Indicates unable to abort the transaction, because it had already been committed or aborted. The call was ignored.
XACT_E_ALREADYINPROGRESS
Indicates a commit operation was already in progress. The call was ignored.
XACT_E_CANTRETAIN
Indicates retaining abort is not supported. The call was ignored.
E_FAIL
Indicates the transaction failed to abort for an unspecified reason.
E_UNEXPECTED
Indicates an unexpected error has occurred. The transaction status is unknown.
XACT_S_ABORTING
Indicates an abort operation was already in progress. The call was ignored.
XACT_E_INDOUBT
Indicates the transaction status is unknown. A communication failure has occurred or a transaction manager or resource manager has failed.
XACT_E_CONNECTION_DOWN
Indicates no longer able to communicate with the transaction manager because the connection to the transaction manager failed. The transaction state is unknown.