Created
November 9, 2012 10:03
-
-
Save madd0/4044962 to your computer and use it in GitHub Desktop.
Better TransactionScope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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