Transactions and WWF

according to Nate (MS) http://blogs.msdn.com/advancedworkflow/archive/2006/03/01/541648.aspx, there are two ways to get a transaction in your workflow. 
 
1°You can model the transaction in your flow using the TransactionScopeActivity which works in a manner analogous to System.Transactions.TransactionScope

using (TransactionScope scope = new TransactionScope())
{
   DoSomething();
   DoSomethingElse();
   scope.Complete();
}

The equivalent workflow would look like:

<TransactionScopeActivity>
   <DoSomething>
   <DoSomethingElse>
</TransactionScopeActivity>

 

2°The other option is to delay the work until the next commit point and borrow the persistence transaction using batching.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s