Export (0) Print
Expand All

ISinglePhaseNotification Interface

Describes a resource object that supports single phase commit optimization to participate in a transaction.

Namespace:  System.Transactions
Assembly:  System.Transactions (in System.Transactions.dll)

public interface ISinglePhaseNotification : IEnlistmentNotification

The ISinglePhaseNotification type exposes the following members.

  NameDescription
Public methodCommitNotifies an enlisted object that a transaction is being committed. (Inherited from IEnlistmentNotification.)
Public methodInDoubtNotifies an enlisted object that the status of a transaction is in doubt. (Inherited from IEnlistmentNotification.)
Public methodPrepareNotifies an enlisted object that a transaction is being prepared for commitment. (Inherited from IEnlistmentNotification.)
Public methodRollbackNotifies an enlisted object that a transaction is being rolled back (aborted). (Inherited from IEnlistmentNotification.)
Public methodSinglePhaseCommitRepresents the resource manager's implementation of the callback for the single phase commit optimization.
Top

You should note that even when your resource manager implements this interface to support single phase commit optimization, it is not guaranteed that it receives a single phase commit. The transaction manager can still send two phase commit notifications instead. For more information on the single phase commit optimization, see Optimization Using Single Phase Commit and Promotable Single Phase Notification.

To enlist your resource manager as a participant in a transaction, call the EnlistVolatile() method or the EnlistDurable() method of the Transaction class. Specifically, the EnlistmentOptions parameter should equal to None to ensure that a single phase commit is performed. If it is mistakenly set to EnlistDuringPrepareRequired, no single phase commit occurs.

Since the ISinglePhaseNotification interface derives from the IEnlistmentNotification interface, the resource manager must also implement all the methods of the latter for two phase commit notifications. It is the transaction manager's choice as to whether two phase commit or the single phase commit optimization is used with this resource manager. However, implementing this interface gives the resource manager the opportunity to take advantage of the optimization when it is available.

If the optimization is used and the transaction manager calls the SinglePhaseCommit method of the enlisted resource, the resource manager should respond to this call by using various methods of the SinglePhaseEnlistment class to inform the transaction manager if the transaction is to be committed or rolled back.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft