InstanceLockedException:如何处理锁定问题WF 4.0? [英] InstanceLockedException: How to handle locking issues with WF 4.0?

查看:249
本文介绍了InstanceLockedException:如何处理锁定问题WF 4.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景: 我使用WF 4.0。我的web应用程序和工作流程都在一个农场(4机)上运行。所有的Web应用程序引用到工作流程使用http://本地主机/ ..。工作流持久性使用SQL Server 2005中运行Windows Server 2008上保存在一个数据库中。

Background: I'm using WF 4.0. My web app and workflow are running on a farm (4 machines). All references from web app to workflow use "http://localhost/..". Workflow persistance is kept on one database using SQL Server 2005. Running on Windows Server 2008.

情景: 服务器A创建新的工作流程,当它到达Pick活动,其中包含接收活动作为其分支机构处理完成。就在Pick活动之前,一个应用程序特定的标志在数据库中设置,表明工作流程准备听下一个请求。一个书签是在工作流持久性数据库中创建。 服务器B使用相关性来恢复现有的工作流程和处理继续,直到它到达下一次拾取活性的影响。等等等等。

Scenario: ServerA creates new workflow and processing completes when it reaches a Pick Activity which contains Receive Activities as its branches. Just before the Pick activity, an app-specific flag is set in the database to indicate that workflow is ready to listen to the next request. A bookmark is created in the workflow persistance database. ServerB uses correlation to resume the existing workflow and processing continues until it reaches the next Pick Activity. And on and on.

情景上述工作正常,在大多数情况下,除了当服务器B试图恢复的应用程序相关的标志被设定后不久的工作流程。这个标志是一个自定义操作,让我通知他可以继续进行下一个操作的用户。 然而,在大多数情况下,这将与一个InstanceLockedException失败。服务器表明,有许多的尝试,然后尝试重定向到另一个服务器时,它抛出另一个异常叫RedirectionException。之前

Scenario above works fine in most cases, except when ServerB attempts to resume the workflow soon after the "app-specific flag" is set. This flag is a custom action that allows me to notify the user that he can continue with the next operation. HOWEVER, in most cases this will fail with an InstanceLockedException. The server shows that there were a number of attempts and then it tries to redirect to yet another server before it throws another exception called RedirectionException.

目前我的WCF配置设置为以下内容:

Currently my WCF configuration is set to the following:

<sqlWorkflowInstanceStore connectionString="[conn str]"
instanceEncodingOption="None"
instanceCompletionAction="DeleteNothing"
instanceLockedExceptionAction="BasicRetry"
hostLockRenewalPeriod="00:00:30"
runnableInstancesDetectionPeriod="00:00:05" />

我不知道我是否应该使用AgressiveRetry或更改的更新与检测时间......或者,如果我需要做的完全不同的东西。 您的意见是很大的AP preciated。

I'm not sure if I should use AgressiveRetry or change the renewal and detection periods... Or if I need to do something totally different. Your input is greatly appreciated.

推荐答案

请确保您设置timeToUnload和timeToPersist为00:00:00。这是推荐设置负载均衡WF主机。

Make sure you set the timeToUnload and timeToPersist to 00:00:00. This is the recommended setting for load balanced wf hosts.

http://msdn.microsoft.com/en-us/library/ ff383824.aspx

这篇关于InstanceLockedException:如何处理锁定问题WF 4.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆