locked
not found in state persistence store

    Question

  • I started wwf state machine runtime by:

    _wfrServer = new WorkflowRuntime();
    ExternalDataExchangeService wfExchange = new ExternalDataExchangeService()
    _wfrServer.AddService(wfExchange);
    SqlWorkflowPersistenceService stateService = new SqlWorkflowPersistenceService(ConnString
    )
    _wfrServer.AddService(stateService);
    _wfrServer.StartRuntime();

    When wwf arise on delay activity(first time, to be idled), I got exception:

     InnerException {"Workflow with id \"b74cbe7e-1080-4351-b06b-766c006f6e66\" not found in state persistence store."} System.Exception {System.InvalidOperationException}

    theory: When WWF wait delay (10 sec..), it occured WorkflowIdled handler. At that moment, wwf is persisted at database (insert into, not select like exception message said).

    What is wrong? I observed by sql profiler, SqlPersistenceService attempt to execute only select sql procedure.

    Tuesday, March 21, 2006 1:14 PM

Answers

  • Hi,
    here is solution!

    - WorkflowInstance.Unload() doesn't work correct in my sample. Nothing in persitence store, no exceptions...It must be some internal logging at debug for Microsoft team, for internal purpose.
    - Decompiling method Unload by Lutz Roeder's .Net Reflector. And here is: <add name="WorkflowTraceToDefault" value="1" />
    - It makes WorkflowTrace.log, where we have everything, what we need. I didn't make to be seriazable custom class library, which I used at statemachine workflow. I fixed that, and now is ok.


    In sequential workflows, it is FaultHandler for this purpose, I didn't find at stateworkflow some activity for root exceptions.


    Bojan
       

    Saturday, March 25, 2006 12:30 PM

All replies

  • Hi,

    Try:

     SqlWorkflowPersistenceService stateService = new SqlWorkflowPersistenceService(ConnString, true, new TimeSpan(0, 0, 0, 10, 0), new TimeSpan(0, 0, 0, 10, 0));

     This creates the sql persistence with the UnloadOnIdle setting = true.

    Hope this helps!

    Shawn

     

    Tuesday, March 21, 2006 7:56 PM
  • Unfortunately no...

    I tried by setting UnloadOnIdle on true, but nothing... 

    Wednesday, March 22, 2006 7:45 AM
  • Hi,

    I've only seen this message when the workflow is in fact completed and the persistence service cleans it up.  But I'm mostly using Statemachine workflows.

    Maybe try adding the tracking service and then reviewing the workflow's tracking history.

    The WorkflowMonitor example is a good starting point to review workflow histories - either active or completed.  This example is usually found in:

    c:\program files\microsoft sdks\windows workflow foundation\samples.zip.

    Hope this helps!


    Shawn
    Wednesday, March 22, 2006 3:16 PM
  • What is the significance of the ownership time and the loading interval? As usual, the documentation here sucks. If I set the ownership time to a value that is too small, what will happen?

     

    Wednesday, March 22, 2006 3:41 PM
  • Hi,
    here is solution!

    - WorkflowInstance.Unload() doesn't work correct in my sample. Nothing in persitence store, no exceptions...It must be some internal logging at debug for Microsoft team, for internal purpose.
    - Decompiling method Unload by Lutz Roeder's .Net Reflector. And here is: <add name="WorkflowTraceToDefault" value="1" />
    - It makes WorkflowTrace.log, where we have everything, what we need. I didn't make to be seriazable custom class library, which I used at statemachine workflow. I fixed that, and now is ok.


    In sequential workflows, it is FaultHandler for this purpose, I didn't find at stateworkflow some activity for root exceptions.


    Bojan
       

    Saturday, March 25, 2006 12:30 PM
  • I really don't know if it is the same problem, but I got this exception when I added both the SqlTrackingService and the SqlWorkflowPersistenceService to the runtime. The solution was adding the SharedConnectionWorkflowCommitWorkBatchService as well. Somehow it helps those two, to use the same connection string.
    Friday, August 04, 2006 12:41 PM
  • I had got the same problem and the same solution worked for me too. Notice that all three services must have same connection string, this means that Persistence Data and Tracking Data are on the same database.

    MS bug or normal behaviour?

    Friday, January 26, 2007 11:43 PM