SqlWorkflowInstanceStore无法访问持久性数据库时没有错误 [英] No error when SqlWorkflowInstanceStore cannot access the persistence DB
问题描述
我有一个工作流,可以通过在WorkflowApplication.PersistableIdle中返回PersistableIdleAction.Persist来使用SqlWorkflowInstanceStore进行持久化.当提供正确的连接字符串时,这可以很好地工作.但是,如果连接字符串不正确,但我没有收到错误,则SqlWorkflowInstanceStore似乎只是默默地失败了.
I have a workflow that I am persisting using the SqlWorkflowInstanceStore, by returning PersistableIdleAction.Persist in WorkflowApplication.PersistableIdle. This works fine when the correct connection string is provided. However, if the connection string is incorrect I do not get an error, the SqlWorkflowInstanceStore seems to just silently fail.
当InstanceStore无法访问数据库或由于其他原因失败时,是否有一种通知方式?
Is there a way to be notified when the InstanceStore cannot access the DB or fails for another reason?
推荐答案
您可以使用跟踪来查看错误.
还应该能够设置实例的OnUnhandledException函数.
类似这样的东西:
instance.OnUnhandledException =(WorkflowApplicationUnhandledExceptionEventArgs e)=> /> {
Console.WriteLine(e.UnhandledException.Message + Environment.NewLine + e.UnhandledException.StackTrace);
返回UnhandledExceptionAction.Terminate;
};
谢谢!
斯科特
You can use tracking to see the errors.
You should also be able to set the OnUnhandledException func of the instance.
Something like this:
instance.OnUnhandledException = (WorkflowApplicationUnhandledExceptionEventArgs e) =>
{
Console.WriteLine(e.UnhandledException.Message + Environment.NewLine + e.UnhandledException.StackTrace);
return UnhandledExceptionAction.Terminate;
};
Thanks!
Scott
这篇关于SqlWorkflowInstanceStore无法访问持久性数据库时没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!