locked
Problems sharing workflow instance store between hosts RRS feed

  • Question

  • Ok thanks...

    now I have another problem, I deploy my application on two machines  A and B,  both use the same SQL database for persistence and business data.
    when an instance is created from the application A and persisted in the DB, it can not be loaded by the application B..? is this normal? what should we do?

    Listen
    Read phonetically
     
    Thursday, March 10, 2011 5:02 PM

All replies

  • Hi,

    ->"when an instance is created from the application A and persisted in the DB, it can not be loaded by the application B..? is this normal? what should we do?"

    Yes, it is normal. we can set DefaultInstanceStoreOwner property, so that App B can resume persisted workflow initialized by App A.

          。。。
    InstanceHandle
     handle = instanceStore.CreateInstanceHandle();
                InstanceView view = instanceStore.Execute(handle,
                                                          new CreateWorkflowOwnerCommand(),
                                                          TimeSpan.FromSeconds(5));
                handle.Free();
                instanceStore.DefaultInstanceOwner = view.InstanceOwner;
    return instanceStore;

    Hope this helps
    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
    Friday, March 11, 2011 2:14 AM
  • Thanks ...

    But, i use WCF workflow Service (xamlx) hosted in IIS, how can i set this(DefaultInstanceOwner)? in web.config?

    the behavior declaration in my web.config is :

    <behavior name="WFProduitServiceBehavior">
    <serviceMetadata httpGetEnabled="true" />

    <sqlWorkflowInstanceStore connectionString="my connection string here" hostLockRenewalPeriod="00:00:05" runnableInstancesDetectionPeriod="00:00:05" instanceEncodingOption="None" instanceCompletionAction="DeleteAll" instanceLockedExceptionAction="AggressiveRetry" />
    <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>

    Regards

    Friday, March 11, 2011 10:57 AM