Platform SDK: Transaction Server

ITransactionResourceAsync::PrepareRequest

The MS DTC proxy calls this method to prepare a transaction (phase one of the two-phase commit protocol).

HRESULT PrepareRequest (
BOOL
fRetaining,
DWORD
grfRM,
BOOL
fWantMoniker,
BOOL
fSinglePhase);

Parameters

fRetaining [in]
FALSE for MS DTC version 1.0.

grfRM [in]
Values from XACTRM.

fWantMoniker [in]
FALSE for MS DTC version 1.0.

fSinglePhase [in]
If TRUE, it indicates that the RM is the only resource manager enlisted on the transaction.

Return Values

S_OK
Success. The resource manager’s transaction object has started preparing.

Comments

The resource manager needs to return from this call as soon as the transaction object starts preparing. After the transaction object is prepared the resource manager needs to call ITransactionEnlistmentAsync::PrepareRequestDone.

If fSinglePhase flag is TRUE, it indicates that the RM is the only resource manager enlisted on the transaction. and therefore it has the option to perform the single phase optimization. If the RM does choose to perform the single phase optimization, then it lets the Transaction Coordinator know of this optimization by providing XACT_S_SINGLEPHASE flag to the ITransactionEnlsitementAsync::PrepareRequestDone.