locked
Exception when Persistence and Tracking Services are used together... RRS feed

  • Question

  • Have a state machine workflow that gets started inside the Application_Start of a Web Service.  As long as I have EITHER the Persistence service OR Tracking added, everything runs just fine.  But ONLY when I add both, I get the following:

    Exception Details: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Workflow.Activities.EventDeliveryFailedException: Event "OrderCreated" on interface type "WorkflowCommunication.IOrderController" for instance id <GUID> cannot be delivered. ---> System.InvalidOperationException: Workflow with id <GUID> not found in state persistence store.
      at System.Workflow.Runtime.Hosting.PersistenceDBAccessor.RetrieveInstanceState(Guid instanceStateId, Guid ownerId, DateTime timeout)
      at System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService.LoadWorkflowInstanceState(Guid id)
      at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor)
      at System.Workflow.Runtime.WorkflowRuntime.Load(Guid& key, CreationContext context)
      at System.Workflow.Runtime.WorkflowInstance.EnqueueItemOnIdle(IComparable queueName, Object item, IPendingWork pendingWork, Object workItem)
      at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)
      --- End of inner exception stack trace ---
      at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)
       --- End of inner exception stack trace ---

     

    I believe I'm on Beta 2 of VS 2005 Extensions for WF running on Windows 2003 Server.  The Persistence and Tracking databases are on the same machine, just different catalogs.  I've tried clearing up both databases and it did not matter.  Any tricks to using both of these services or could I be dealing with an indirect cause?

    Monday, September 18, 2006 6:03 PM

Answers

  • Actually we recommend that you run both the SqlWorkflowPersistenceService and the SqlTrackingService using the same database and that you use the SharedConnectionWorkflowCommitWorkBatchService.  The reason for this is to avoid distributed transactions.  You'll see a perf impact using DTCs.  Using a single database and a shared connection can avoid a propegating your transactions to DTCs in many (but sometimes not all) scenarios.

    Thanks,
    Joel West
    MSFTE - SDE in WF runtime and hosting

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

    Tuesday, September 19, 2006 7:33 PM

All replies

  • Other than recommending you to upgrade to WF RC avaliable here and try again, can you briefly describe your scenario and what you workflow is doing?

    Monday, September 18, 2006 7:33 PM
  • Khalid, the workflow takes order data at a web site that pushes it to a web service, which then starts the workflow runtime and the first event (order created) gets raised in the state machine... 

    After I submitted the question, I went ahead and combined the two databases into one, made the necessary config and connectionString changes and ran the solution again, which was successful.  I realize I should not have to run tracking and persistence on the same database, so I will come back to this, but for now, I guess it's alright.

    I really appreciated your prompt response; please let me know if you still run into anything related to this issue... 

    Thanks,

    -devsultan

    Monday, September 18, 2006 9:35 PM
  • Actually we recommend that you run both the SqlWorkflowPersistenceService and the SqlTrackingService using the same database and that you use the SharedConnectionWorkflowCommitWorkBatchService.  The reason for this is to avoid distributed transactions.  You'll see a perf impact using DTCs.  Using a single database and a shared connection can avoid a propegating your transactions to DTCs in many (but sometimes not all) scenarios.

    Thanks,
    Joel West
    MSFTE - SDE in WF runtime and hosting

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

    Tuesday, September 19, 2006 7:33 PM