views:

199

answers:

1

I've done this before, so I know it's possible, but I can't seem to remember how exactly to accomplish it. I need to set the LoadingInterval and InstanceOwnershipDuration from the app.config. Can someone please point me in the right direction. I'm currently using the following which isn't working:

    <Runtime>
  <CommonParameters>
    <add name="ConnectionString" value="*****"/>
  </CommonParameters>
  <Services>
    <!-- Persistence -->
    <add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" InstanceOwnershipDuration="10" LoadingInterval="30" />
    <!-- Tracking -->
    <add type="System.Workflow.Runtime.Tracking.SqlTrackingService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UseDefaultProfile="true"/>
    <!--Data Exchanges-->
    <add type="System.Workflow.Activities.ExternalDataExchangeService, System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" ConfigurationSection="Workflow/ExternalDataExchangeServices" />
    <!-- Default Workflow Scheduler-->
    <add type="System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <!-- Work Batch Service -->
    <add type="System.Workflow.Runtime.Hosting.SharedConnectionWorkflowCommitWorkBatchService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" EnableRetries="true" />
  </Services>
</Runtime>
+1  A: 

Cracked open the System.Workflow.Runtime assembly with Reflector and found the following parameter names for the SqlWorkflowPersistenceService:

ConnectionString
OwnershipTimeoutSeconds
UnloadOnIdle
LoadIntervalSeconds
EnableRetries

So I setup my persistence configuration line like the following and everything works:

<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService,  
System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" OwnershipTimeoutSeconds="10" LoadIntervalSeconds="30" />
Matt Ruwe