什么可能导致 DurableInstancing.InstanceNotReadyException,以及如何修复它?
我们有一个管理文档生命周期的业务逻辑。
这是使用 Workflow Foundation 4 和 WF Persistence 实现的。 在工作流执行期间,工作流中会创建某些书签,并且计划任务会定期查找所有特定书签并恢复工作流 (正在执行的活动会执行一些处理并再次为工作流添加书签,以便稍后可以恢复工作流。)
现在,对于工作流的某些正在运行的实例,我们收到以下错误:
System.Runtime.DurableInstancing.InstanceNotReadyException was unhandled Message=The execution of an InstancePersistenceCommand was interrupted because the instance '99ce9413-5b17-4de0-a453-46891509e032' has not yet been persisted to the instance store. Source=System.Runtime.DurableInstancing StackTrace: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.Runtime.DurableInstancing.InstancePersistenceContext.OuterExecute(InstanceHandle initialInstanceHandle, InstancePersistenceCommand command, Transaction transaction, TimeSpan timeout) at System.Runtime.DurableInstancing.InstanceStore.Execute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout) at System.Activities.WorkflowApplication.PersistenceManager.Load(TimeSpan timeout) at System.Activities.WorkflowApplication.LoadCore(TimeSpan timeout, Boolean loadAny) at System.Activities.WorkflowApplication.Load(Guid instanceId, TimeSpan timeout) at System.Activities.WorkflowApplication.Load(Guid instanceId)
之前相同的实例已成功加载。
我有几个与此异常相关的问题:
- 我们什么时候可以获得此异常?
- 如果我们收到此异常,是否有任何优雅的方法来处理它,以便稍后可以恢复相同的实例?
- 还有什么方法可以修复由于此异常而无法恢复的现有工作流实例?
We have a business logic for managing the document life cycle.
This is implemented using Workflow Foundation 4 and WF Persistence.
During the execution of the workflow, certain bookmarks are created in the workflow and a scheduled task periodically finds all the specific bookmarks and resumes the workflow
(The activity being executed does some processsing and bookmarks the workflow again so that the workflow can be resumed later.)
Now for some of the running instances of the workflow, we receive the following error:
System.Runtime.DurableInstancing.InstanceNotReadyException was unhandled Message=The execution of an InstancePersistenceCommand was interrupted because the instance '99ce9413-5b17-4de0-a453-46891509e032' has not yet been persisted to the instance store. Source=System.Runtime.DurableInstancing StackTrace: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.Runtime.DurableInstancing.InstancePersistenceContext.OuterExecute(InstanceHandle initialInstanceHandle, InstancePersistenceCommand command, Transaction transaction, TimeSpan timeout) at System.Runtime.DurableInstancing.InstanceStore.Execute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout) at System.Activities.WorkflowApplication.PersistenceManager.Load(TimeSpan timeout) at System.Activities.WorkflowApplication.LoadCore(TimeSpan timeout, Boolean loadAny) at System.Activities.WorkflowApplication.Load(Guid instanceId, TimeSpan timeout) at System.Activities.WorkflowApplication.Load(Guid instanceId)
previously the same instances were loaded successfully.
I have a couple of questions related to this exception:
- When can we get this exception?
- If we get this exception is there any graceful way of handling it so that the same instances can be resumed later?
- Also is there any way of fixing the existing workflow instances which could not be resumed because of this exception?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是在您不断更改工作流程的开发机器上吗?我之前收到过此错误,并且必须清理我的持久性数据库。这是一个可以为您完成此操作的脚本。
让我知道这是否适合您!
Is this on your development machine in which you are consistently making changes to the workflows? I have received this error before and had to clean my persistence database. Here is a script that will do that for you.
Let me know if this works for you!