O'Reilly logo

Microsoft® Windows® Workflow Foundation Step by Step by Kenn Scribner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unloading Instances

Although there are specific times WF will unload and persist your workflow instance, in some cases you might want to take control of that yourself. For those situations, WorkflowInstance.Unload and WorkflowInstance.TryUnload are there to help.

If you call either of these methods without first plugging in the SqlWorkflowPersistenceService, WF will throw an exception. Of course, if there is a database error of some kind, you’ll also receive an exception. Therefore, it’s good practice to wrap these calls in try/catch blocks to keep from crashing your entire application. (Note that’s not to say you have to do anything with the exception...sometimes you may just want to ignore it.)

Let’s try it out! In fact, let’s build a small graphical ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required