Platform SDK: Transaction Server

ITransactionVoterBallotAsync::VoteRequestDone

An application server invokes the VoteRequestDone method to submit a vote during the prepare phase of a transaction.

HRESULT VoteReqDone (
HRESULT
hr,
BOID *
pboidReason);

Parameters

hr [in]
HRESULT returning a transaction voter's vote. An application sets this value to S_OK or XACT_OK_NONOTIFY to sanction the transaction. XACT_OK_NONOTIFY specifies that the voter does not want the transaction manager to return with an outcome notification. E_FAIL specifies that the MS DTC should abort the transaction.

pboidReason [in]
Pointer to a BOID returning a transaction abort reason code. This value should be NULL if the voter sanction the transaction. Otherwise, the voter can optionally set this value with an abort reason.

Return Values

S_OK
Success.

E_INVALIDARG
One or more parameters were invalid. For example, pboidReason must NULL if hr == S_OK.

E_UNEXPECTED
An unexpected error occurred.

E_FAIL
VoteRequestDone was called illegally.

XACT_E_CONNECTION_DOWN
Lost connection with the TM.

Comments

The vote is submitted when the MS DTC sends it a vote request through the ITransactionVoterNotifyAsync interface. The voter can either sanction the transaction or vote against it. If a voter successfully votes to abort a transaction, it will not be notified of the transaction outcome.