ITransactionResourceAsync::PrepareRequest

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);

fRetaining
[in] Always FALSE.

grfRM
[in] Values from XACTRM.

fWantMoniker
[in] Always FALSE

fSinglePhase
[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:

S_OK
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.

Platforms: Windows 2000, Windows XP, Windows Server 2003

Header: Declared in txcoord.h

Show:
© 2014 Microsoft