Entity Framework transaction model
I would like to know if it is possible to use another transaction system in EF that it is not System.Transaction. Could I use an abstrac开发者_StackOverflow中文版tion of the system.transaction in it?
Regards.
I must admit I'm relatively new to Entity Framework, but I've been doing mega amounts of research recently and have just come across some links on msdn which might help you.
From http://msdn.microsoft.com/en-us/library/bb896325.aspx
When you call SaveChanges, if a current transaction exists, the Entity Framework uses this transaction for operations against the data source. Otherwise, it creates a new transaction for the operation. You can define transactions by using EntityTransaction, Transaction, or TransactionScope.
Taking a look at "EntityTransaction" it inherits from DbTransaction, which in turn implements IDbTransaction, IDisposable and inherits MarshalByRefObject. So perhaps you can implement IDbTransaction etc to customise what you require?
精彩评论