locked
how to make multiple WorkflowServiceHost sharing the same SQL db for persist RRS feed

  • Question

  • I've searched around but most topics are related to WF 3 so it's very much appreciated if anyone can shed some light on this.

    I'm developing an ordering system which includs multiple types of workflows for different orders types. The console host holds a list of WorkflowServiceHost and each WorkflowServiceHost is specialised to load a specific xamls for its own WorkflowService.

    I added SqlWorkflowInstanceStoreBehavior to each WorkflowServiceHost so the workflow state can be persisted with a SQL server database.

    I'm trying to understand here is how to make different WorkflowServiceHosts to share the same SQL database for persist, is it possible for one WorkflowServiceHost (A) to go idle/persist and a different WorkflowServiceHost (B) picks up what A just persisted and try to continue execute the workflow. Obviously this won't work because B loads a different xaml definition which is different from A.


    Life is simple.
    Friday, June 3, 2011 12:46 PM

Answers

  • The instance store loads instances that has a matching the owner. Please check this article for more info about workflow owner http://msdn.microsoft.com/en-us/library/ee829481.aspx

    By default, in WSH, the service scope name, i.e. namespace + name, makes the differentiation.

    Best Regards,

    Leo

    This posting is provided "AS IS" with no warranties, and confers no rights.

     

    • Marked as answer by Andrew_Zhu Friday, June 10, 2011 8:41 AM
    Friday, June 3, 2011 6:17 PM
  • Hi, Firen

    If Server A and B share the same workflow xaml file. then, it is ok to reume a workflow instance persisted in other server.
    For performance consideration. WF4 persistence will only store the execution context information, but won't persist the workflow definition info.

    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 Friday, June 10, 2011 8:41 AM
    Wednesday, June 8, 2011 3:27 AM

All replies

  • The instance store loads instances that has a matching the owner. Please check this article for more info about workflow owner http://msdn.microsoft.com/en-us/library/ee829481.aspx

    By default, in WSH, the service scope name, i.e. namespace + name, makes the differentiation.

    Best Regards,

    Leo

    This posting is provided "AS IS" with no warranties, and confers no rights.

     

    • Marked as answer by Andrew_Zhu Friday, June 10, 2011 8:41 AM
    Friday, June 3, 2011 6:17 PM
  • Thanks Leo, will take a look at the article..
    Life is simple.
    Saturday, June 4, 2011 12:45 AM
  • Hi, Firen

    If Server A and B share the same workflow xaml file. then, it is ok to reume a workflow instance persisted in other server.
    For performance consideration. WF4 persistence will only store the execution context information, but won't persist the workflow definition info.

    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 Friday, June 10, 2011 8:41 AM
    Wednesday, June 8, 2011 3:27 AM