Platform SDK: Transaction Server |
ITransactionEnlistmentAsync::PrepareRequestDone
The resource manager invokes this method to inform the transaction manager that it has completed the prepare phase of the two-phase commit protocol.
HRESULT PrepareRequestDone (
HRESULT |
hr, |
IMoniker * |
pmk, |
BOID * |
pboidReason); |
Parameters
hr [in]
The resource manager uses the hr parameter to inform the transaction manager of the outcome of the prepare phase.
Value of hr parameter | Meaning |
---|---|
S_OK | Success. The transaction is prepared. |
XACT_S_READONLY | Success. The resource manager votes yes because the transaction was read-only. Note that the resource manager will not be notified of the commit. |
E_FAIL | Failure. The resource manager has aborted the transaction. |
E_UNEXPECTED | Failure. An unknown error occurred. The resource is in an indeterminate state. The transaction will abort. |
XACT_S_SINGLEPHASE | Success: The resource manager has committed the transaction and does not want commit notification. Note that this HRESULT should be specified only if the fSinglePhase flag was TRUE in the call to ITransactionResourceAsync::PrepareRequest. |
pmk [in]
Must be NULL.
pboidReason [in]
Pointer to a BOID explaining why the transaction could not be prepared. This parameter must be NULL if hr is S_OK, XACT_S_READONLY or XACT_S_SINGLEPHASE.
Return Values
S_OK
Success.
E_UNEXPECTED
An unexpected error occurred.
E_INVALIDARG
The value of pboidReason must be NULL for the specified hr or an invalid hr was specified.
E_FAIL
PrepareRequestDone was called illegally.
XACT_E_NOTSINGLEPHASE
Indicates that the fSinglePhase flag to the ITransactionResourceAsync call was FALSE, but the RM is trying to do the single-phase optimization.