ASP.NET & SQL Persistence/Tracking Woes

I'm attempting to add SQL Persistence and Tracking to my ASP.NET StateMachine workflow, and I'm not having luck. I added the following to me web.config file:

<WorkflowRuntime Name="WorkflowServiceContainer">
<Services>
<add type="System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService,
System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
<add type="System.Workflow.Activities.ExternalDataExchangeService,
System.Workflow.Activities, Version=3.0.00000.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService,
System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" connectionString="Data Source=MyComputer;Initial Catalog=TrackingStore;Integrated Security=True"
LoadIntervalSeconds="2" UnloadOnIdle="true" />
<add type="System.Workflow.Runtime.Tracking.SqlTrackingService,
System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" connectionString="Data Source=MyComputer;Initial Catalog=TrackingStore;Integrated Security=True" />
</Services>
</WorkflowRuntime>

When I try to raise an event, I get the following exception:

System.Workflow.Activities.EventDeliveryFailedException: Event "RecordCreated" on interface type "RecordsLocalServices.IRecordService" for instance id "73a2e450-9e6f-4b52-a2a5-2ff6e7de6e5a" cannot be delivered. ---> System.InvalidOperationException: Workflow with id "73a2e450-9e6f-4b52-a2a5-2ff6e7de6e5a" not found in state persistence store.

Any ideas

Thank you in advance,

--
Sean


Answer this question

ASP.NET & SQL Persistence/Tracking Woes

  • randy_w_s

    Can you verify before making the call that the workflow was persisted in the database Are you able to run the sample without any errors



  • kyus94

    Hi All,

    The above sqldump exception can be rectified by installing Sql server 2000 Service pack 4.

    Regards,

    Baskar



  • Greg Mandel

    Check this post for adding persistence service and tracking service for ASP.NET based workflows.

    Are you setting the workflow instance Id in the eventargs while raising the event

    e.g.

    if (orderApproved != null)

    orderApproved(null, new OrderEventArgs(workflowInstanceId, orderId));



  • Johan Petersson

    It was my own fault. I ran the SQL scripts from your sample in Query Analyzer and didn't look at the scripts you provided, which run a few more scripts from the WinFX directory.

    Thank you for your help,

    --
    Sean

  • sysmaya

    yea also if ur database is not located together with ur web client, you need to goto component service under adminsitration of control panel, goto my computer and config the MSDTC to allow network access (allow incoming and outgoing)

    marty


  • Sridhar Madhugiri

    I tried running the sql persistence sample using the share database for persistence and tracking service.

    The first page loads fine. When i click the create new order button, a row is inserted into the instancestate table of the sqlpersistence service database.

    When i click the createOrder button, i am getting the following error as the row got deleted from the instancestate table.

    Workflow with id "eca3bd1f-1506-4f3a-997d-e62b9e9a6d02" not found in state persistence store.

    I checked the profiler and found the following sp is being called:-

    declare @P1 int
    set @P1=0
    declare @P2 uniqueidentifier
    set @P2=NULL
    exec InsertInstanceState @uidInstanceID = 'ECA3BD1F-1506-4F3A-997D-E62B9E9A6D02', @state = 0x, @status = 3, @unlocked = 1, @blocked = 0, @info = N'SqlDumpExceptionHandler: Process 54 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
    SqlDumpExceptionHandler: Process 54 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
    ', @ownedUntil = 'Dec 31 9999 11:59PM', @ownerID = default, @nextTimer = 'Jun 15 2006 11:09AM', @result = @P1 output, @currentOwnerID = @P2 output
    select @P1, @P2

    declare @P1 int
    set @P1=-1
    declare @P2 uniqueidentifier
    set @P2=NULL
    exec RetrieveInstanceState @uidInstanceID = 'ECA3BD1F-1506-4F3A-997D-E62B9E9A6D02', @ownerID = default, @ownedUntil = 'Dec 31 9999 11:59PM', @result = @P1 output, @currentOwnerID = @P2 output
    select @P1, @P2

    Any inputs on this is highly appreciated.

    Regards,

    Baskar



  • TerryG

    I'm working on my program using that sample as a model.

    Thank you,

    --
    Sean

  • Sunil Sinha

    Though I notice that you have solved your problem, I thought I'd add another bit of information. I was having the same error message, and found out that the problem was I did not have the DTC (Distributed Transaction Coordinator) service started.

    Jeff



  • ASP.NET & SQL Persistence/Tracking Woes