SqlWorkflowPersistenceService Class

SqlWorkflowPersistenceService Class

 
Note: This API is now obsolete.

Represents a persistence service that uses a SQL database to store workflow state information.

Namespace:   System.Workflow.Runtime.Hosting
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)


[ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class SqlWorkflowPersistenceService : WorkflowPersistenceService, 
	IPendingWork

NameDescription
System_CAPS_pubmethodSqlWorkflowPersistenceService(NameValueCollection)

Initializes a new instance of the SqlWorkflowPersistenceService class by using the specified parameters.

System_CAPS_pubmethodSqlWorkflowPersistenceService(String)

Initializes a new instance of the SqlWorkflowPersistenceService class by using the database connection string.

System_CAPS_pubmethodSqlWorkflowPersistenceService(String, Boolean, TimeSpan, TimeSpan)

Initializes a new instance of the SqlWorkflowPersistenceService class using a database connection string and other parameters.

NameDescription
System_CAPS_pubpropertyEnableRetries

Gets and sets a value that specifies whether the SqlWorkflowPersistenceService retries committing a work batch.

System_CAPS_pubpropertyLoadingInterval

Gets the length of the loading interval.

System_CAPS_protpropertyRuntime

Gets the WorkflowRuntime for this service.(Inherited from WorkflowRuntimeService.)

System_CAPS_pubpropertyServiceInstanceId

Gets the service instance identifier.

System_CAPS_protpropertyState

Gets the state of the WorkflowRuntimeService.(Inherited from WorkflowRuntimeService.)

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetAllWorkflows()

Retrieves instance descriptions of all persisted workflows.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodLoadCompletedContextActivity(Guid, Activity)

Retrieves the specified completed scope from the database.(Overrides WorkflowPersistenceService.LoadCompletedContextActivity(Guid, Activity).)

System_CAPS_pubmethodLoadExpiredTimerWorkflowIds()

Retrieves a list of ids for workflows with expired timers.

System_CAPS_protmethodLoadWorkflowInstanceState(Guid)

Retrieves the specified workflow instance state from the database.(Overrides WorkflowPersistenceService.LoadWorkflowInstanceState(Guid).)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnStarted()

Starts a new timer and recovers running workflow instances.(Overrides WorkflowRuntimeService.OnStarted().)

System_CAPS_protmethodOnStopped()

When overridden in a derived class, represents the method that will be called when the workflow runtime engine raises the WorkflowRuntime.Stopped event.(Inherited from WorkflowRuntimeService.)

System_CAPS_protmethodRaiseServicesExceptionNotHandledEvent(Exception, Guid)
System_CAPS_protmethodSaveCompletedContextActivity(Activity)

Saves the state of the specified completed scope.(Overrides WorkflowPersistenceService.SaveCompletedContextActivity(Activity).)

System_CAPS_protmethodSaveWorkflowInstanceState(Activity, Boolean)

Saves the specified workflow instance state.(Overrides WorkflowPersistenceService.SaveWorkflowInstanceState(Activity, Boolean).)

System_CAPS_protmethodStart()

Starts the SqlWorkflowPersistenceService.(Overrides WorkflowRuntimeService.Start().)

System_CAPS_protmethodStop()

Stops the service and the timer. (Overrides WorkflowRuntimeService.Stop().)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_protmethodUnloadOnIdle(Activity)

Returns a value that indicates whether the workflow is unloaded when it is in an idle state.(Overrides WorkflowPersistenceService.UnloadOnIdle(Activity).)

System_CAPS_protmethodUnlockWorkflowInstanceState(Activity)

Unlocks access to the specified workflow instance state.(Overrides WorkflowPersistenceService.UnlockWorkflowInstanceState(Activity).)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIPendingWork.Commit(Transaction, ICollection)

Writes an ICollection of serialized state objects to the database.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIPendingWork.Complete(Boolean, ICollection)

Completes the work batch and releases any resources.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIPendingWork.MustCommit(ICollection)

Returns a value that indicates whether the collection of serialized state objects should be written to the database.

System_CAPS_noteNote

This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

The SqlWorkflowPersistenceService class represents a fully-functional persistence service. You can use this service out-of-box to persist and retrieve workflow state information about a workflow instance when requested to by the workflow runtime engine.

The SqlWorkflowPersistenceService participates in the workflow transaction batching functionality provided by the WorkflowCommitWorkBatchService. That is, it adds objects that represent pending writes to the SQL database to the WorkBatch and implements the IPendingWork interface.

The SqlWorkflowPersistenceService supports locking of workflow instances. This feature is used when several workflow runtimes share the same database. A column in the SQL database table is used to mark a workflow instance as locked whenever it is being used by a workflow runtime. The SqlWorkflowPersistenceService does not load a workflow instance that is marked as "in use" by another runtime. Typically these locks are released when the workflow instance is persisted, for example, on idle, completion, or termination. The locks can also be released automatically after a period of inactivity. This period of inactivity can be set using the constructor of the SqlWorkflowPersistenceService class. It can also be set through the configuration file.

For more information about persistence services in general, see the WorkflowPersistenceService class.

Workflow instances can contain timers, for example, if they have a DelayActivity. For workflows that contain timers, the SqlWorkflowPersistenceService records the time when the workflow's next timer expires. The SqlWorkflowPersistenceService periodically polls the database, looking for workflows whose timers have expired. The frequency of the polling interval can be set using the SqlWorkflowPersistenceService constructor or using a configuration file.

System_CAPS_noteNote

When using both the SqlTrackingService and the SqlWorkflowPersistenceService in a workflow application, it is recommended to use a single database for both persistence and tracking.

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft