Skip to main content
.NET Framework Class Library
SqlWorkflowInstanceStore Class

Derives from the abstract InstanceStore class of the persistence functionality and provides implementation to allow saving instance state information to and loading instance state information from an SQL Server 2005 or SQL Server 2008 database.

Inheritance Hierarchy
SystemObject
   System.Runtime.DurableInstancingInstanceStore
    System.Activities.DurableInstancingSqlWorkflowInstanceStore

Namespace:   System.Activities.DurableInstancing
Assembly:  System.Activities.DurableInstancing (in System.Activities.DurableInstancing.dll)
Syntax
Public NotInheritable Class SqlWorkflowInstanceStore _
	Inherits [%$TOPIC/ee248447_en-us_VS_110_3_0_0_0_0%]
public sealed class SqlWorkflowInstanceStore : [%$TOPIC/ee248447_en-us_VS_110_3_0_1_0_0%]
public ref class SqlWorkflowInstanceStore sealed : public [%$TOPIC/ee248447_en-us_VS_110_3_0_2_0_0%]
[<[%$TOPIC/ee248447_en-us_VS_110_3_0_3_0_0%]>]
type SqlWorkflowInstanceStore =  
    class 
        inherit [%$TOPIC/ee248447_en-us_VS_110_3_0_3_0_1%] 
    end
public final class SqlWorkflowInstanceStore extends [%$TOPIC/ee248447_en-us_VS_110_3_0_4_0_0%]

The SqlWorkflowInstanceStore type exposes the following members.

Constructors
  NameDescription
Public method SqlWorkflowInstanceStoreInitializes a new instance of the SqlWorkflowInstanceStore class.
Public method SqlWorkflowInstanceStore(String)Initializes a new instance of the SqlWorkflowInstanceStore class by using the connectionString parameter.
Top
Properties
  NameDescription
Public property ConnectionStringGets or sets a connection string with parameters that are used to connect to an underlying persistence database.
Public property DefaultInstanceOwnerGets or sets the default instance owner. (Inherited from InstanceStore.)
Public property EnqueueRunCommandsGets or set a value that indicates whether Run commands are enqueued. This property is used internally by the SQL Workflow Instance Store and it should not be used in your applications.
Public property HostLockRenewalPeriodSpecifies the time period within which the host renews its lock on a workflow service instance.
Public property InstanceCompletionActionSpecifies the action to be taken after a workflow instance completes. Possible values are “DeleteNothing” and “DeleteAll”. The default value is “DeleteAll”. If the property is set to “DeleteNothing”, the persistence provider keeps all the instance data and metadata in the persistence database after the workflow instance completes. If the property is set to “DeleteAll”, the persistence provider deletes all the instance data and metadata after the workflow instance completes.
Public property InstanceEncodingOptionSpecifies a value that indicates whether the instance data must be compressed.
Public property InstanceLockedExceptionActionSpecifies the action to be taken when the persistence provider catches an InstanceLockedException.
Public property MaxConnectionRetriesGets or sets the maximum number of SQL connection retries. The default value is 4.
Public property RunnableInstancesDetectionPeriodSpecifies the time period after which the SQL Workflow Instance Store runs a detection task to detect any runnable or activatable workflow instances in the persistence database after the previous detection cycle.
Top
Methods
  NameDescription
Public method BeginExecuteAsynchronously executes persistence commands such as LoadWorkflowCommand and SaveWorkflowCommand. (Inherited from InstanceStore.)
Protected method BeginTryCommandA persistence provider implements this method, which determines whether a particular persistence command can be executed. If the command can be executed, executes the command asynchronously. (Inherited from InstanceStore.)
Public method BeginWaitForEventsBegins an asynchronous operation to listen for any events raised by the instance store for a specific instance handle. (Inherited from InstanceStore.)
Public method CreateInstanceHandleCreates an instance handle. (Inherited from InstanceStore.)
Public method CreateInstanceHandle(Guid)Creates an instance handle. If the DefaultInstanceOwner is set, the value is automatically bound as the new handle’s instance owner. The instance identifier passed as a parameter is automatically bound as the new handle’s instance. (Inherited from InstanceStore.)
Public method CreateInstanceHandle(InstanceOwner)Creates an instance handle. If the instance owner passed as a parameter is not null, the value is automatically bound as the new handle’s instance owner. (Otherwise, no instance owner is bound, even if DefaultInstanceOwner is set.) (Inherited from InstanceStore.)
Public method CreateInstanceHandle(InstanceOwner, Guid)Creates an instance handle. If the instance owner passed as a parameter is not null, the value is automatically bound as the new handle’s instance owner. (Otherwise, no instance owner is bound, even if DefaultInstanceOwner is set.) The instance identifier passed as a parameter is automatically bound as the new handle’s instance. (Inherited from InstanceStore.)
Public method EndExecuteEnds the asynchronous operation. (Inherited from InstanceStore.)
Protected method EndTryCommandEnds an asynchronous operation. (Inherited from InstanceStore.)
Public method EndWaitForEventsEnds the asynchronous operation initiated by the BeginWaitForEvents method. (Inherited from InstanceStore.)
Public method Equals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method ExecuteExecutes a persistence command synchronously. Examples of persistence commands are: LoadWorkflowCommand and SaveWorkflowCommand. (Inherited from InstanceStore.)
Public method GetHashCodeServes as the default hash function. (Inherited from Object.)
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method PromoteAssociates the specified properties with a workflow instance so that you can query for instances based on specific values for these properties. These properties that can be used in external queries can be of simple types (for example: Int64, String, and so on) or of a serialized binary type (byte[]). Binary properties are typically used to store tracking data.
Public method ToStringReturns a string that represents the current object. (Inherited from Object.)
Protected method TryCommandA persistence provider implements this method, which determines whether a particular persistence command can be executed and if the command can be executed executes it asynchronously. (Inherited from InstanceStore.)
Public method WaitForEventsA workflow host typically invokes this method to wait for an event to be signaled. (Inherited from InstanceStore.)
Top
Remarks

SqlWorkflowInstanceStore uses the NetDataContractSerializer to serialize complex types; all types used in workflows to be persisted with this instance store must be serializable using NetDataContractSerializer.

Examples

The following code sample demonstrates creating a SqlWorkflowInstanceStore. This example is from the Persistence Participants sample.

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

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