DurableServiceAttribute.SaveStateInOperationTransaction 屬性

定義

取得或設定值,此值表示是否會採用與執行作業相同的異動,將服務執行個體的狀態保存至 PersistenceProvider

public:
 property bool SaveStateInOperationTransaction { bool get(); void set(bool value); };
public bool SaveStateInOperationTransaction { get; set; }
member this.SaveStateInOperationTransaction : bool with get, set
Public Property SaveStateInOperationTransaction As Boolean

屬性值

Boolean

若服務執行個體的狀態會使用相同交易保存,則為 true,否則為 false

備註

SaveStateInOperationTransaction 設為 true,則服務上的所有作業必須標示已設為 OperationBehaviorAttribute.TransactionScopeRequiredtrue,或標示 TransactionFlowOption.Mandatory。 此外,ConcurrencyMode 必須設為 Single

SaveStateInOperationTransaction 設為 true,會使服務狀態與作業異動一同異動化。 這表示若作業的交易復原,則服務狀態也會復原。

適用於