Skip to content

Instantly share code, notes, and snippets.

@madd0
Created November 9, 2012 10:03
Show Gist options
  • Save madd0/4044962 to your computer and use it in GitHub Desktop.
Save madd0/4044962 to your computer and use it in GitHub Desktop.
Better TransactionScope
// As per http://blogs.msdn.com/b/dbrowne/archive/2010/06/03/using-new-transactionscope-considered-harmful.aspx
public class TransactionUtils {
public static TransactionScope CreateTransactionScope()
{
var transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = IsolationLevel.ReadCommitted;
transactionOptions.Timeout = TransactionManager.MaximumTimeout;
return new TransactionScope(TransactionScopeOption.Required, transactionOptions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment