Getting InstanceNotReadyException for a persisted workflow?
-
Monday, August 06, 2012 6:48 AM
We're using a State Machine Workflow in WF4 with WorkflowApplication, and SqlWorkflowInstanceStore for persistence. Things work as expected, ie, we can create a workflow, resume it later for all the different bookmarks, no problems at all.
After we update the database using our database deployment package, we consistently start getting this exception whenever we try to load an existing workflow:
The execution of an InstancePersistenceCommand was interrupted because the instance '<guid>' has not yet been persisted to the instance store.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Runtime.DurableInstancing.InstancePersistenceContext.OuterExecute(InstanceHandle initialInstanceHandle, InstancePersistenceCommand command, Transaction transaction, 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)
However the instances are definitely serialized - I've taken snapshots of the tables before and after the exception starts happening, and there are no changes at all, so the error message is misleading. I can't find any evidence that the database update is actually doing anything that could affect the workflow tables at all.
What else could cause this type of error to occur? This is a serious problem for us.
Any help appreciated.
Thanks,
Sam
All Replies
-
Wednesday, August 08, 2012 6:38 AMModerator
Hi,
Does it occurs when you tried to load any workflow instance? I'd suggest you run the query in the following article to see if it is actually a non-persisted workflow instance:
Non-Persisted Instances
http://msdn.microsoft.com/en-us/library/ff729669
Hope this information helps, thanks.
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked As Answer by LeoTangModerator Monday, August 13, 2012 2:42 AM

