Collapse the table of content
Expand the table of content



The 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


[in] Always FALSE.


[in] Values from XACTRM.


[in] Always FALSE


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

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:


Success. The resource manager's transaction object has started preparing.

The resource manager needs to return from this call as soon as it has asynchronously started a request to prepare its enlistment object. After the enlistment 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. Therefore the resource manager 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 ITransactionEnlistmentAsync::PrepareRequestDone. If the resource manager chooses not to perform the single phase optimization then the transaction manager will perform the second phase of the two-phase commit protocol.

For an explanation of the requirement values, see Requirements (Component Services).

Platforms: Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista

Header: Declared in txcoord.h

Community Additions

© 2016 Microsoft