EnlistmentOptions EnlistmentOptions EnlistmentOptions EnlistmentOptions Enum

定义

确定是否应该在准备阶段登记该对象。Determines whether the object should be enlisted during the prepare phase.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class EnlistmentOptions
[System.Flags]
public enum EnlistmentOptions
type EnlistmentOptions = 
Public Enum EnlistmentOptions
继承
EnlistmentOptionsEnlistmentOptionsEnlistmentOptionsEnlistmentOptions
属性

字段

EnlistDuringPrepareRequired EnlistDuringPrepareRequired EnlistDuringPrepareRequired EnlistDuringPrepareRequired 1

该对象必须在提交过程的初始阶段中进行登记。The object must enlist during the initial phase of the commitment process.

None None None None 0

该对象在提交过程的初始阶段中不需要登记。The object does not require enlistment during the initial phase of the commitment process.

注解

此枚举传递到EnlistVolatileEnlistDurable和方法来通知事务管理器资源管理器是否需要创建另一个登记的准备阶段。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.

如果在登记期间指定 EnlistDuringPrepareRequired,则资源管理器指示它想要接收准备通知,而新的登记仍允许的事务。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. 通过此操作,事务变为 2 阶段提交 (2PC) 协议的参与者将登记持久资源。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.

如果未指定,登记指示,它将不会收到准备通知直到已经太迟在 2PC 中创建新的登记。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.

适用于