We have implemented Windows Workflow foundation with persistence in c#.NET. In various flows, it is running smoothly, but in 2 to 3 days of time, any of the workflow instance is suddenly disappearing from persistence tables without leaving any clue.
We have searched for exceptions, but no luck. not even in event viewer.
Any help is this regard will be appreciated.
We have searched over internet, but no luck.
NA
Why my workflow is deleting automatically from persistence tables?
I suspect that your workflow instance encountered an unhandled exception, which by default terminates the workflow completely and also removes any persistence information for it as well.
At the very least, you can see if any exception does occur within a workflow instance by adding a handler to the
WorkflowApplication.OnUnhandledExceptionproperty. See here for more information on that property.There is a way to augment that default behavior so any unhandled exception in a workflow application leaves its instance information in the persistence store, by adding the
WorkflowUnhandledExceptionBehavior.The highlights of using that behavior is giving you the option to "rollback" a running instance to a previously persisted state. It does also give the capability of simply retaining the persistence information even if it encountered an unhandled exception. Documentation on setting up that behavior can be found here.