EnlistmentOptions Enum

Definition

Determines whether the object should be enlisted during the prepare phase.

This enumeration supports a bitwise combination of its member values.

C#
[System.Flags]
public enum EnlistmentOptions
Inheritance
EnlistmentOptions
Attributes

Fields

Name Value Description
None 0

The object does not require enlistment during the initial phase of the commitment process.

EnlistDuringPrepareRequired 1

The object must enlist during the initial phase of the commitment process.

Remarks

This enumeration is passed into the EnlistVolatile and EnlistDurable and methods to notify the transaction manager whether the resource manager needs to create another enlistment during the Prepare phase. For more information on enlistment, see Enlisting Resources as Participants in a Transaction.

If EnlistDuringPrepareRequired is specified during enlistment, the resource manager indicates that it wants to receive a Prepare notification while new enlistments are still allowed for the transaction. A resource manager who acts as a cache for another durable resource, such as a backend database, would probably use this option during enlistment. When the caching resource gets its Prepare notification, it transfers its content to the durable resource. By doing so, the durable resource enlists on the transaction to become a participant of the 2 Phase Commit (2PC) protocol. Before this happens, only the caching resource (not the durable resource) was enlisted.

If None is specified, the enlistment indicates that it will not receive a Prepare notification until it is too late to create new enlistments in 2PC. In our preceding scenario, if a caching resource specifies this option during enlistment, and attempts to flush its cache during the Prepare notification, the durable resource gets an exception when it attempts on enlisting since it is too late.

None should be used as a default.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1