user60456
user60456

Reputation:

Stop Workflow from Unloading

Is it possible to make a Workflow not unload when it has become idle?

Upvotes: 1

Views: 221

Answers (1)

Neil Barnwell
Neil Barnwell

Reputation: 42165

Are you talking about SQL persistence? You could just not add the SqlPersistenceService, but that would affect all workflow instances, so might not be a good idea.

I'm not sure you'd want to do this, though. Workflow Foundation uses the threadpool to process workflow instances, so if you keep a workflow instance "alive" longer than necessary, it's taking up a threadpool thread. While performance isn't great in WF 3.0, I'm not sure this is a good approach to fixing it. WF 4.0 has (allegedly) much better performance, assuming that's your goal?

The workflow will be unloaded when it becomes idle - that's just what happens. If you have added the SqlPersistenceService, then it will be persisted to SQL Server, otherwise it's just kept in memory while the thread is returned to the threadpool. You can't change this behaviour AFAIK.

Upvotes: 1

Related Questions