Problems with state persistence and timer services
Hi, I've experimented with adding the SQL state, timer and tracking services to the Lab1 sample step 4 (the expense report approval workflow). The tracking service works fine, but it seems that the state and timer services get the engine stuck on the ListenForManagerApproval activity. If I disable the state and timer services the workflow unfolds as expected.
I use the (really cool) Workflow Monitor sample to view the results, and the progress is evident every time: With the state and/or timer service enabled, the flow gets stuck on ListenForManagerApproval and then after a while the workflow gets the status "aborted".
Any ideas why this happens? The databases are perfectly OK and initialized using the provided scripts.
[746 byte] By [
MikaelN] at [2007-12-17]
Nope, I've tried both combinations, i.e. only the timer service and only the state service, and the result is the same, the workflow is aborted immediately after the
ListenForManagerApproval activity. Also, nothing is ever written to either the timer or state tables.
Btw. has anybody else encountered this problem?
Can you add a terminated handler and examine the reason for the failure?
In Main(), add
workflowRuntime.WorkflowTerminated +=
new EventHandler<WorkflowTerminatedEventArgs>(workflowRuntime_WorkflowTerminated);
...and,
static
void workflowRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
{
Console.WriteLine(e.Reason);
}
Great idea, but the flow never gets to that stage. I get a WorkflowAborted event but never a WorkflowTerminated event, and the WorkflowAborted event does not give a reason, just a normal WorkflowEventArgs object.
But thanks for the suggestion. Btw. the last activity (ListenForManagerApproval) is marked as Executing in the monitor.
Do the services work for you?
The services were added as follows:
private void StartWorkflowHost()
{
// Create a new Workflow Runtime
workflowRuntime = new WorkflowRuntime();
SqlStatePersistenceService statePersistence = new SqlStatePersistenceService(connstr);
workflowRuntime.AddService(statePersistence);
SqlTrackingService tracking = new SqlTrackingService(connstr);
workflowRuntime.AddService(tracking);
// Start the Workflow services
workflowRuntime.StartRuntime();
...
The tracking service works just fine, but the state service fails as described in previous posts. But good to hear that it works for you, then it's probably just something with my installation, and I'll try reinstalling at some later point. Thanks.
Hi, are you by any chance using SQL Server 2000, because if you are this wont work. I had the same problem i switched from 2000 to Express and it worked fine
Srikanth, no, I have not seen any problem, yet (has not yet used the feature). I was just alarmed by Ranjan's post.
I have encountered the same problem: the sqltrackingservice works well, but the sqlstatepersistence doesn't work.
My environment: visual studio 2005 beta2, windows workflow foundation beta1, sql server 2000, windows xp professional.
is it for the sql server 2000?