6. Transactions

WF aligns with the programming model for transactions that is provided by the System.Transactions namespace in the .NET Framework. There is plenty of documentation and additional explanatory material that has been written about this API—and we encourage you to familiarize yourself with the specifics—but the bottom line is that System.Transactions presents a simplified model for using transactions such that the nuts and bolts of managing a transaction (e.g., the selection of transaction managers, enlistment of resources, and transaction promotion) are, unless you need to get to them, agreeably out of sight.

Thus in C#, you just write the following:

using (TransactionScope ts = new TransactionScope()){  // use transactional resources… ...

Get Essential Windows Workflow Foundation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.