ITransactionVoterFactory::Create
This method creates the transaction voter object and exchanges the ITransactionVoterNotifyAsync and ITransactionVoterBallotAsync sinks between the transaction voter and the MS DTC proxy.
HRESULT Create (
ITransaction * |
pITransaction, |
ITransactionVoterNotifyAsync * |
pITransactionVoterNotify, |
ITransactionVoterBallotAsync ** |
ppITransactionVoterBallot); |
Parameters
pITransaction [in]
Pointer to the ITransaction interface associated with the transaction object on which the transaction voter enlists.
pITransactionVoterNotify [in]
Pointer to the ITransactionVoterNotifyAsync sink exported by the transaction voter.
pITransactionVoterBallot [out]
Pointer to a pointer of an ITransactionVoterBallotAsync interface supplied to vote on the outcome of a distributed transaction with which it is associated.
Return Values
S_OK
Success.
E_INVALIDARG
Invalid arguments.
E_OUTOFMEMORY
Unable to allocate memory.
XACT_E_NOTRANSACTION
No transaction corresponding to pITransaction.
XACT_E_TMNOTAVAILABLE
Unable to connect to the transaction manager.
XACT_E_CONNECTION_DOWN
Connection with the transaction manager was lost.
XACT_E_CONNECTION_REQUEST_DENIED
The transaction manager refused to accept a connection.
E_UNEXPECTED
An unexpected error has occurred.
Comments
A transaction voter calls this method on the transaction object for any transaction for which it needs notification of outcome events or would like to veto. The lifetime of a transaction voter object matches that of the transaction with which it is employed.