SqlWorkflowPersistenceService 类

定义

注意

The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

表示一种持久性服务,该服务使用 SQL 数据库存储工作流状态信息。

public ref class SqlWorkflowPersistenceService : System::Workflow::Runtime::Hosting::WorkflowPersistenceService, System::Workflow::Runtime::IPendingWork
public class SqlWorkflowPersistenceService : System.Workflow.Runtime.Hosting.WorkflowPersistenceService, System.Workflow.Runtime.IPendingWork
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class SqlWorkflowPersistenceService : System.Workflow.Runtime.Hosting.WorkflowPersistenceService, System.Workflow.Runtime.IPendingWork
type SqlWorkflowPersistenceService = class
    inherit WorkflowPersistenceService
    interface IPendingWork
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type SqlWorkflowPersistenceService = class
    inherit WorkflowPersistenceService
    interface IPendingWork
Public Class SqlWorkflowPersistenceService
Inherits WorkflowPersistenceService
Implements IPendingWork
继承
属性
实现

注解

注意

本材料讨论的类型和命名空间已废弃不用。 有关详细信息,请参阅 Windows Workflow Foundation 4.5 中弃用的类型

SqlWorkflowPersistenceService 类表示功能完全的持久性服务。 您可以使用这一现成可用的服务,在工作流运行时引擎请求时,保留和检索关于工作流实例的工作流状态信息。

SqlWorkflowPersistenceService 会参与 WorkflowCommitWorkBatchService 所提供的工作流事务批处理功能。 也就是说,它会将表示 SQL 数据库挂起写入的对象添加到 WorkBatch 并实现 IPendingWork 接口。

SqlWorkflowPersistenceService 支持工作流实例的锁定。 此功能用于几个工作流运行时共享同一个数据库的情况。 只要工作流运行时使用了某个工作流实例,SQL 数据库表中的列就会将该工作流实例标记为锁定。 SqlWorkflowPersistenceService 不会加载被另一个运行时标记为“使用中”的工作流实例。 通常,当保留(如空闲、完成或终止)工作流实例时,会释放这些锁定。 另外,在非活动状态持续一段时间后,也可能会自动释放这些锁定。 使用 SqlWorkflowPersistenceService 类的构造函数,可以设置此非活动的时间期限。 还可通过配置文件对其进行设置。

有关持久性服务一般的详细信息,请参阅 WorkflowPersistenceService 类。

例如,如果工作流实例具有 DelayActivity,则它们可以包含计时器。 对于包含计时器的工作流,SqlWorkflowPersistenceService 记录此工作流的下一个计时器过期的时间。 SqlWorkflowPersistenceService 会定期轮询数据库,查找计时器已过期的工作流。 轮询间隔的频率可以使用 SqlWorkflowPersistenceService 构造函数或配置文件进行设置。

注意

如果在工作流应用程序中同时使用 SqlTrackingServiceSqlWorkflowPersistenceService,建议为持久性和跟踪使用单一数据库。

构造函数

SqlWorkflowPersistenceService(NameValueCollection)
已过时.

使用指定的参数初始化 SqlWorkflowPersistenceService 类的新实例。

SqlWorkflowPersistenceService(String)
已过时.

使用数据库连接字符串初始化 SqlWorkflowPersistenceService 类的新实例。

SqlWorkflowPersistenceService(String, Boolean, TimeSpan, TimeSpan)
已过时.

使用数据库连接字符串和其他参数初始化 SqlWorkflowPersistenceService 类的新实例。

属性

EnableRetries
已过时.

获取或设置一个值,该值指定 SqlWorkflowPersistenceService 是否将重试提交工作批次。

LoadingInterval
已过时.

获取加载间隔的长度。

Runtime
已过时.

获取此服务的 WorkflowRuntime

(继承自 WorkflowRuntimeService)
ServiceInstanceId
已过时.

获取服务实例标识符。

State
已过时.

获取 WorkflowRuntimeService 的状态。

(继承自 WorkflowRuntimeService)

方法

Equals(Object)
已过时.

确定指定对象是否等于当前对象。

(继承自 Object)
GetAllWorkflows()
已过时.

检索所有已保留工作流的实例描述。

GetHashCode()
已过时.

作为默认哈希函数。

(继承自 Object)
GetType()
已过时.

获取当前实例的 Type

(继承自 Object)
LoadCompletedContextActivity(Guid, Activity)
已过时.

从数据库中检索指定的已完成范围。

LoadExpiredTimerWorkflowIds()
已过时.

检索计时器已过期工作流的 ID 列表。

LoadWorkflowInstanceState(Guid)
已过时.

从数据库中检索指定的工作流实例状态。

MemberwiseClone()
已过时.

创建当前 Object 的浅表副本。

(继承自 Object)
OnStarted()
已过时.

启动新的计时器,并恢复运行中的工作流实例。

OnStopped()
已过时.

在派生类中重写时,表示将在工作流运行时引擎引发 Stopped 事件时调用的方法。

(继承自 WorkflowRuntimeService)
RaiseServicesExceptionNotHandledEvent(Exception, Guid)
已过时.

引发 ServicesExceptionNotHandled 事件。

(继承自 WorkflowRuntimeService)
SaveCompletedContextActivity(Activity)
已过时.

保存指定的已完成范围的状态。

SaveWorkflowInstanceState(Activity, Boolean)
已过时.

保存指定的工作流实例状态。

Start()
已过时.

启动 SqlWorkflowPersistenceService

Stop()
已过时.

停止服务和计时器。

ToString()
已过时.

返回表示当前对象的字符串。

(继承自 Object)
UnloadOnIdle(Activity)
已过时.

返回一个值,该值指示是否在工作流处于空闲状态时将其卸载。

UnlockWorkflowInstanceState(Activity)
已过时.

解除对指定工作流实例状态访问的锁定。

显式接口实现

IPendingWork.Commit(Transaction, ICollection)
已过时.

将序列化状态对象的 ICollection 写入数据库。

IPendingWork.Complete(Boolean, ICollection)
已过时.

完成工作批次并释放任何资源。

IPendingWork.MustCommit(ICollection)
已过时.

返回一个值,该值指示序列化状态对象的集合是否应写入数据库。

适用于