Question

I would like the rule for which "Persist activities cannot be contained within no persistence blocks" error happens in WF4. I see that you can not persist between the first receive-send, but I do not understand the general idea.

Any comment?

Thanks

Was it helpful?

Solution

The goal of a no persist zone it to indicate that you are doing something that can't be resumed from the middle of it. For example a Receive and SendReply action, if you persist in the middle you can also resume from there if the workflow aborts at some later point. If you resume before the SendReply the first step after resuming is to send the reply but as there is no request there is no place to send the reply to. The same is try for a TransactionScope, you can't restart in the middle of the transaction.

So basically whenever you drop a persist activity on the workflow think of is as being able to resume the workflow from that point after reloading it from disk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top