0
votes

After doing some refactoring to my WF4 service, I got this exception when calling some of the operations:

The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}LoadWorkflowByInstanceKey was interrupted by an error.

My xamlx file contains a few receive/sendreplytoreceive pairs, as shown below. The exception sometimes happens on receive2, sometimes receive3.

  • receive1 (no correlation, cancreateinstance=true)
  • send reply to receive (initializes content correlation on generated ID)

  • receive2 (correlates on ID, cancreateinstance=false)

  • send reply to receive

  • receive 3 (correlates on ID, cancreateinstance=false)

  • send reply to receive

After doing a lot of debugging and making sure all correlations where set up right, the exception disappeared for new instances of the workflow.

What does the exception mean, and why did it show up and why did it dissappear all of a sudden? Is it a code/xamlx issue or something with the infrastructure (AppFabric/SQL)?

I'm hosting the WF service with IIS/AppFabric, using AppFabric' SQL persistence.

3
I've done some more testing now. The exception comes and goes. For some wf instances all calls go through without errors, other instances fail, typically at receive3.jonsb
I'm not sure off the top of my head what's causing the problem -- however you may want to consider reading through this brief blog article so that you can get what I consider the most amazing logging available for WF (thanks @Ron Jacobs!) blogs.msdn.com/b/rjacobs/archive/2011/12/16/…Mike Perrenoud
@jonsb having the same issue... but mine is persistent...Leonardo

3 Answers

1
votes

According to this support note this error can be the result of a race condition between the Receive and a Delay activity expiring. Is this possible in your workflow.

0
votes

I kinda figured mine out... aparently if you point your persistance store in a SQL previous to 2012 you get the error... so all i had to do is put mine persistance store in a SQL 2012...

0
votes

When I had this problem it turned out to be a mistake in my connection string when instantiating the persistence store object.

SqlWorkflowInstanceStore store = new SqlWorkflowInstanceStore(connStr);

I realise this an old question but fixing the connection string got rid of my error while running store.Execute() so I thought I'd share!