locked
“Persist activities cannot be contained within no persistence blocks” error RRS feed

  • Question

  • Hello,

    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

    Friday, August 13, 2010 9:12 AM

Answers

  • You can resume it as you resume any instance from latest persisted point. If you're using AppFabric to host your service, you can take a look of this blog and see how this property makes it easier to recover the service.

    Monday, August 16, 2010 8:54 AM

All replies

  • If Persist activity is executed in a non-persist scope, you'll see the error. Any Activity derived NativeActivity can request entering a no-persist block by NoPersistHandle.  You can take a look of this sample for more detailes http://msdn.microsoft.com/en-us/library/dd807512.aspx. This is implementation level information, I'm afraid there's no way to tell from public API of a activity.

    Monday, August 16, 2010 6:35 AM
  • Ok, thanks for the answer, I can see it clearer not. But for instance: if I create a sequence with: receive, persist, sendreply it fails. I understand that receive-response creates a no-persist block. But, what about the persistbeforesend in the sendreply activity? Why does it not fail if I check it? Could that name be wrong?
    Monday, August 16, 2010 7:29 AM
  • When PersistBeforeSend is set to be true, SendReply will use the NoPersistHandle to exit no-persist scope first and then persist.
    Monday, August 16, 2010 8:14 AM
  • Ummmm, persist and later send the response? It does not make sense to me, how will you recover from that persistence point if the call is dead (for instance in a timeout)? When should I use that?
    Monday, August 16, 2010 8:26 AM
  • You can resume it as you resume any instance from latest persisted point. If you're using AppFabric to host your service, you can take a look of this blog and see how this property makes it easier to recover the service.

    Monday, August 16, 2010 8:54 AM