OperationContext.Current is getting null when enabling Workflow Persistence

225 Views Asked by At

I am using WF 4.5 and Devart dotConnect(for persistence). I am hosting my WorkflowService in net.Tcp protocol using WorkflowServiceHost. I am sending some information in IncomingMessageHeaders of OperationContext.Current. It all works perfectly fine until I enable persistence. As soon as persistence is enabled the OperationContext.Current gets null. I dont know why this is happening and both the data in OperationContext and Persistence are necessary. Here is my config

Behaviors.config:

<behaviors>
  <endpointBehaviors>
    <behavior name="ParametersInHeaderBehaviour">
      <HeaderExtension />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="WorkflowService_Behavior">
      <!--<workflowServiceTrace />-->
      <!--<serviceMetadata httpGetEnabled="true" />-->
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceAuthorization principalPermissionMode="Custom" serviceAuthorizationManagerType="Capita.Prism.Authorization.Foundation.Managers.UserAuthorizationManager, Capita.Prism.Authorization.Foundation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
        <authorizationPolicies>
          <add policyType="Authorization.Foundation.ADMappingPolicy, Authorization.Foundation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
        </authorizationPolicies>
      </serviceAuthorization>
      <!--<oracleTracking connectionString="User Id=workflow;Password=oracle;Server=DEVDB;" profileName="Sample Tracking Profile"/>
      <oracleInstanceStore connectionString="User Id=workflow;Password=oracle;Server=DEVDB;" instanceEncodingOption="None" instanceCompletionAction="DeleteNothing" instanceLockedExceptionAction="NoRetry" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05"/>-->
      <workflowIdle timeToUnload="0"/>
      <workflowUnhandledException action="AbandonAndSuspend"/>
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

Using this behavior OperationContext.Current is available but as soon as I uncomment oracleTracking and oracleInstanceStore the OperationContext.Current is set to null.

Please help!!!

0

There are 0 best solutions below