Platform SDK: Transaction Server

ITransaction::Abort

This method aborts the transaction.

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

Parameters

pboidReason [in]
An optional BOID that indicates why the transaction is being aborted. This argument may be NULL indicating that no abort reason is provided.

fRetaining [in]
Must be FALSE.

fAsync [in]
When fAsync is TRUE, an asynchronous abort is performed and the caller must use ITransactionOutcomeEvents to learn the outcome of the transaction.

Return Values

S_OK
Success: the transaction was successfully aborted.

XACT_S_ASYNC
An asynchronous Abort was specified. The abort 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 abort the transaction because it had already been committed or aborted. This call was ignored.

XACT_E_ALREADYINPROGRESS
A Commit operation was already in progress. This call was ignored.

XACT_E_CANTRETAIN
Retaining Abort is not supported. This call was ignored.

E_FAIL
The transaction failed to abort for an unspecified reason.

E_UNEXPECTED
An unexpected error has occurred. The transaction status is unknown.

XACT_S_ABORTING
An Abort operation was already in progress. This call was ignored.

XACT_E_INDOUBT
The transaction status is in-doubt. A communication failure has occurred or a transaction manager or resource manager has failed.

XACT_E_CONNECTION_DOWN
No longer able to communicate with the transaction manager because the connection to the transaction manager failed. The transaction state is unknown.

Comments

The initiator of the transaction may abort the transaction as may any resource manager enlisted on the transaction.

Abort may be invoked on a transaction repeatedly. XACT_S_ABORTING HRESULT will be returned following the first invocation of Abort.

If a communication failure occurs during a call to Commit or Abort, the status of the transaction is unknown.