SALES: 1-800-867-1380
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InstanceStore.Execute Method

.NET Framework 4.6 and 4.5

Executes a persistence command synchronously. Examples of persistence commands are: LoadWorkflowCommand and SaveWorkflowCommand.

Namespace:  System.Runtime.DurableInstancing
Assembly:  System.Runtime.DurableInstancing (in System.Runtime.DurableInstancing.dll)

public InstanceView Execute(
	InstanceHandle handle,
	InstancePersistenceCommand command,
	TimeSpan timeout


Type: System.Runtime.DurableInstancing.InstanceHandle

An instance handle.

Type: System.Runtime.DurableInstancing.InstancePersistenceCommand

The command to be executed.

Type: System.TimeSpan

The timeout value for the operation.

Return Value

Type: System.Runtime.DurableInstancing.InstanceView
An InstanceView object representing the known state of the instance after the successful completion of the command. If Execute was called under a transaction, this state may include uncommitted data. Once the transaction is committed successfully, the data in the InstanceView object can be considered committed

A host calls the Execute method to execute a persistence command against an instance handle, which the host obtains by invoking the CreateInstanceHandle method. The instance handle may be bound to entities that represent the context and subject of the command, such as an instance, instance owner, or instance lock. Only one command may be issued against an instance handle at a time.

Caution noteCaution

If this method is executed with a CreateWorkflowOwnerCommand, it will create an InstanceOwner and bind it to the instance. This means that no other process will be able to access that workflow; if the process ends, the workflow cannot be recovered or executed. If such a workflow is executed again, a InstanceLockedException will be thrown.

If CreateWorkflowOwnerCommand is not used, the instance store will create a temporary InstanceOwner that will be deleted at the end of the process. However, if the process ends before the workflow’s final persistence point, this exception will be thrown, unless the period of time specified in the HostLockRenewalPeriod parameter has expired.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft