locked
WWF OwnershipTimeOut issue RRS feed

  • Question

  • I'm facing a problem while using out of box Sql persistence service in my web application which is tightly integrated with the workflow.

    The scenario is :-
    1. I've a 3 tier architecture
    2. Workflow works parallel to other layers.
    3. Web Application is hosted on IIS.
    4. I'm using OOB Sql persistence Service.
    5. I'm using ManualWorkflowScheduler service.

    In this scenario when a user persist the workflow after taking some action, and after this another user did some action from his machine.

    OwnershipTimeout Exception occur. In my case I have choosen the following configuration for SqlPersistence:-

    persistenceService = new System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService(connectionString, false, new TimeSpan(0, 0, 1, 30), new TimeSpan(0, 2, 0));

     

     

    Wednesday, January 31, 2007 6:32 AM

Answers

  • Unless you are having multiple hosts for the workflow, the instanceOwnershipDuration shoule be set to TimeSpan.MaxValue. This tells the SqlWorkflowPersistenceService that there will be only one host and that locking should not be performed.

    Also, you have the UnloadOnIdle set to false. When are you performing your persisting and rehydrating of the workflow? If a Workflow is loaded from persistence it is locked, and it is not unlocked until it is repersisted.

    If the Workflow may be hosted on multiple hosts at the same time (different WorkflowRuntimes, most likely running in different host processes, that point to the same persistence store and running the same set of workflows) then you should set a value for the instanceOwnershipDuration that is *guaranteed* to be longer than the longest burst of time that a workflow can execute between idle time. If the value is too short, then by the time the workflow goes to persist, the instanceOwnershipDuration time will have elapsed and persistence will fail, and the workflow will abort.

    If this doesn't resolve your issue then please post more details of your scenario:

    1. How many different host processes will be running workflows

    2. Where and how does your persistence take place

    Thanks,

    Steve Danielson [Microsoft]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, January 31, 2007 12:21 PM
    Moderator