Export (0) Print
Expand All
Expand Minimize

Set-ASAppSqlServicePersistence

Set-ASAppSqlServicePersistence

Enables SQL Server persistence, specifies the connection string that will be used to connect to the SQL Server persistence database, and sets advanced persistence related parameters such as InstanceEncodingOption and InstanceLockedExceptionAction at the specified level.

Syntax

Parameter Set: SiteNameAndVirtualPath
Set-ASAppSqlServicePersistence [-SiteName] <String> [[-VirtualPath] <String> ] [-ConnectionString <String> ] [-ConnectionStringName <String> ] [-EnableNetPipeProtocol] [-HostLockRenewalPeriod <TimeSpan> ] [-InstanceCompletionAction {<DeleteAll> | <DeleteNothing>} ] [-InstanceEncodingOption {<GZip> | <None>} ] [-InstanceLockedExceptionAction {<AggressiveRetry> | <BasicRetry> | <NoRetry>} ] [-RunnableInstancesDetectionPeriod <TimeSpan> ] [-UseInherited] [-Confirm] [-WhatIf] [ <CommonParameters>]


Detailed Description

This cmdlet adds a sqlWorkflowInstanceStore element if the element does not already exist in the configuration file associated with the specified scope and sets the values of hostLockRenewalPeriod, runnabletancesDetectionPeriod, instanceEncodingOption, instanceComplectionAction, and instanceLockedExceptionAction attributes on the element .

When you use the parameter –UseInherited with this cmdlet, the cmdlet removes sqlWorkflowInstanceStore element or <remove name=”sqlWorkflowInstanceStore”> element from configuration file associated with the specified scope so that the persistence settings are inherited from a higher scope.

Parameters

-ApplicationObject<ApplicationInfo>

The name of the ApplicationObject, which specifies that the cmdlet will operate on that application.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

-ConnectionString<String>

The connection string that SQL Server persistence provider uses to connect to the persistence database. Example: “Data Source=(local);Initial Catalog=PersistenceDB;Integrated Security=True".


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-ConnectionStringName<String>

Name of a connection string that is defined in a configuration file


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-EnableNetPipeProtocol

Enables the net.pipe protocol at a Web site level or at an application level. When you use this parameter for cmdlet that is run against a service scope, the cmdlet enables the net.pipe protocol for the application that contains the service.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-HostLockRenewalPeriod<TimeSpan>

Specify the interval within which a host must renew its lock on instance before the lock expires. If the host does not renew the lock in the specified time period, the instance is unlocked and another host may obtain the lock on the instance.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-InstanceCompletionAction<InstanceCompletionAction>

Specify whether the instance state information is kept in the persistence database after the workflow service instance is completed. The allowed values for this parameter are: DeleteAll and DeleteNothing.


The acceptable values for this parameter are:

DeleteAll

DeleteNothing



Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-InstanceEncodingOption<InstanceEncodingOption>

Specify whether the instance state information is compressed using the GZip algorithm before the information is saved in the persistence database. The possible values are GZip and None.


The acceptable values for this parameter are:

GZip

None



Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-InstanceLockedExceptionAction<InstanceLockedExceptionAction>

Specify what action a service host should take when it receives an InstanceLockedException when the host tries to lock a workflow service instance because the instance is currently locked by another host.

The options allowed for this field are: None, Basic Retry, and Aggressive Retry. The default value is None. The following list provides you with the descriptions for these three options.


The acceptable values for this parameter are:

AggressiveRetry

BasicRetry

NoRetry



Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-Root

The name of the root application, which specifies that the cmdlet will operate at that scope. If you use the Root parameter, do not use the SiteName, VirtualPath, or Uri parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-RunnableInstancesDetectionPeriod<TimeSpan>

Specifies 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.

Setting a shorter interval for this property reduces the time between the expiration of a timer associated with a workflow instance and the signaling of the event and subsequent loading of the instance. However, it also increases the processing load on a host and may not be desirable in scenarios where durable timers and/or host failures are rare.

The type of the property is TimeSpan and the value of the property follows the format: hh:mm:ss. The minimum value for this property is 00:00:01. The default value for the property is 00:00:05.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-ServiceObject<ServiceInfo>

The name of the ServiceObject, which specifies that the cmdlet will operate on that service. This parameter is typically used to pipe the output of the Get-ASAppService cmdlet to a cmdlet containing the ServiceObject parameter.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

-SiteName<String>

The name of a Web site, as defined in the IIS Connections pane, which specifies that the cmdlet will operate at the scope of that site, or at the scope of an application, virtual directory, or service contained within that site. To the SiteName parameter, you can add the VirtualPath parameter that identifies an application, directory, or service included in the site.

For an application or virtual directory, the virtual path includes the name of the application, as defined in IIS. For a service, the virtual path includes the name of the application, a forward slash, and the name of the .svc file or .xamlx file for the service. The VirtualPath parameter is not necessary for the site scope. The leading "/" character in the virtual path is optional. If you use the SiteName parameter, do not use the Uri parameter..


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Uri<Uri>

A URI for an IIS site, application, virtual directory, or service, which specifies that the cmdlet will operate at that scope. If you use the Uri parameter, do not use the SiteName parameter or the SiteName and VirtualPath parameter set.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-UseInherited

Use this parameter to use inherited settings from the higher scope. When you use this parameter, the cmdlet removes any sqlWorkflowInstanceStore behavior defined at the specified level. The cmdlet also removes any <remove name=”sqlWorkflowInstanceStore”> element from the configuration file.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-VirtualPath<String>

The virtual path for an application, directory, or service, as defined in the IIS Manager Connections pane, which specifies that the cmdlet will operate at the application, virtual directory, or service. You must add the VirtualPath parameter to the SiteName parameter, using SiteName to identify the site that the application, directory, or service is contained within. The leading "/" character in the virtual path is optional.

For an application, the virtual path includes the name of the application, as defined in IIS. For a service, the virtual path includes the name of the application, a forward slash, and the name of the .svc file or .xamlx file for the service. If you use the SiteName and VirtualName parameter set, do not use the Uri parameter.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • None.


Examples

Example 1

This command sets persistence settings at the root level.


Set-ASAppSqlServicePersistence –Root –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString –HostLockRenewalPeriod “00:00:20” –RunnableInstancesDetectionPeriod “00:00:10”–InstanceCompletionAction DeleteAll –InstanceEncodingOption GZip -InstanceLockedExceptionAction BasicRetry

Example 2

This command sets persistence settings at the Web site level.


Set-ASAppSqlServicePersistence –SiteName “Default Web Site” -HostLockRenewalPeriod “00:00:20”

Example 3

These commands set persistence settings at the application level.


Set-ASAppSqlServicePersistence –SiteName “Default Web Site” –VirtualPath “/SampleApp” –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString –RunnableInstancesDetectionPeriod “00:00:10”Get-ASApplication -SiteName "Default Web Site" -VirtualPath "/SampleApp" | Set-ASAppSqlServicePersistence -ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString -RunnableInstancesDetectionPeriod "00:00:10"

Example 4

These commands set persistence settings at the service level.


Set-ASAppSqlServicePersistence –SiteName “Default Web Site” –VirtualPath “/SampleApplication/SampleService.xamlx” –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionStringGet-ASApplicationService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Set-ASAppSqlServicePersistence –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString –HostLockRenewalPeriod “00:00:20” –RunnableInstancesDetectionPeriod “00:00:10

Example 5

These commands set persistence settings at the level determined by using the URI.


Set-ASAppSqlServicePersistence –Uri “http://localhost” –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString –HostLockRenewalPeriod “00:00:20” –RunnableInstancesDetectionPeriod “00:00:10”Set-ASAppSqlServicePersistence –Uri “http://localhost/SampleApp” –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString –HostLockRenewalPeriod “00:00:20” –RunnableInstancesDetectionPeriod “00:00:10”Set-ASAppSqlServicePersistence –Uri “http://localhost/SampleApp/SampleService.xamlx” –ConnectionStringName ApplicationServerWorkflowInstanceStoreConnectionString –HostLockRenewalPeriod “00:00:20” –RunnableInstancesDetectionPeriod “00:00:10”

Example 6

These commands enable net.pipe protocol at site or application levels. If you run this cmdlet with EnableNetPipe parameter against a service scope (or level), the cmdlet enables the net.pipe protocol for the application that contains the service.


Set-ASAppSqlServicePersistence –SiteName “Default Web Site” -EnableNetPipeSet-ASAppSqlServicePersistence –Uri “http://localhost” -EnableNetPipeSet-ASAppSqlServicePersistence –SiteName “Default Web Site” –VirtualPath “/samplapp” -EnableNetPipeSet-ASAppSqlServicePersistence –Uri “http://localhost/sampleapp” -EnableNetPipeSet-ASAppSqlServicePersistence –SiteName “Default Web Site” –VirtualPath “/sampleapp/sampleservice.xamlx” -EnableNetPipeSet-ASAppSqlServicePersistence –Uri “http://localhost/sampleapp/sampleservice.xamlx” -EnableNetPipe
Show:
© 2014 Microsoft