ASP.NET & SQL Persistence/Tracking Woes  
Author Message
senfo





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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


Software Development for Windows Vista4  
 
 
SonaliC





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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));



 
 
senfo





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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

Thank you,

--
Sean

 
 
Tom Lake





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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



 
 
senfo





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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

 
 
siva_Baskar





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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:-






SqlDumpExceptionHandler: Process 54 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.






Any inputs on this is highly appreciated.

Regards,

Baskar



 
 
siva_Baskar





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

Hi All,

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

Regards,

Baskar



 
 
JFox





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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



 
 
martinkwong





PostPosted: Windows Workflow Foundation, ASP.NET & SQL Persistence/Tracking Woes Top

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