jonsb
jonsb

Reputation: 2064

Why do I get exception "The execution of the InstancePersistenceCommand named LoadWorkflowByInstanceKey was interrupted by an error"

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.

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.

Upvotes: 0

Views: 4754

Answers (3)

I Webb
I Webb

Reputation: 11

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!

Upvotes: 0

Leonardo
Leonardo

Reputation: 11387

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...

Upvotes: 0

Maurice
Maurice

Reputation: 27632

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.

Upvotes: 1

Related Questions