locked
TransactionScope - why isn't the persist optional? RRS feed

  • Question

  • In the case of a WCF WF service, you have a request/reply pair. Between the request/reply the area is known to be a no-persist zone.

    Consequently, if you attempt to insert a TransactionScope activity into the no-persist zone, then you will get an error at runtime because the implicit persistence point at the completion of the TransactionScope will fail since the workflow cannot be persisted before the response is sent.  

    You CAN write a custom activity, include a standard .Net TransactionScope and insert this into the no-persist zone and this will work fine (as it does not try to "persist"). On that basis, why can't you have a TransactionScope without persistence there too?

    The odd thing is, even if you don't configure persistence at all (i.e. no InstanceStore), the TransactionScope will still fail.





     


    Tuesday, April 5, 2011 1:54 PM

Answers

  • Hi, Jimasp

    If a workflow service instance is persisted between a Receive-Send paired activity. this workflow will never have a chance to resume running. To enable TransactionScope or persist workflow after receiving a message. we can combine "Single" Receive/Send activities. rather than using "ReceiveAndSendReply" activity.

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Tuesday, April 12, 2011 3:45 AM
    Monday, April 11, 2011 1:55 AM