Created
January 30, 2016 19:25
-
-
Save zabulus/1e46010094e1b6678729 to your computer and use it in GitHub Desktop.
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
public static DbTransaction CreateWriteTransaction(this System.Data.Entity.Database self) | |
{ | |
DbTransaction ret; | |
self.Connection.Open(); | |
if (self.Connection is FbConnection) | |
{ | |
FbTransactionOptions options = new FbTransactionOptions() { TransactionBehavior = FbTransactionBehavior.Write | FbTransactionBehavior.ReadCommitted | FbTransactionBehavior.NoRecVersion | FbTransactionBehavior.Wait }; | |
ret = ((FbConnection)self.Connection).BeginTransaction(options); | |
} | |
else | |
{ | |
ret = self.Connection.BeginTransaction(); | |
} | |
self.UseTransaction(ret); | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment