This issue has been reported in UserVoice (currently with 6 votes):
http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/1917783-support-transactions-for-dbcontext-database-sqlque
On one hand we expose the store connection on DbContext.Database.Connection by design. On the other hand, we currently rely on the EntityConnection.CurrentTransaction internal property to wire up transactions to the database commands created for ObjectContext.ExecuteStoreQuery and ObjectContext.ExecuteStoreCommand, which is not set correctly by just beginning a local transaction on the underlying connection.
We potentially have worse problems on save, since we use the same EntityConnection.CurrentTransaction property to wire up the transaction used in individual commands in the update pipeline and in the logic that figures out whether we need to create our own local transaction in SaveChanges.
http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/1917783-support-transactions-for-dbcontext-database-sqlque
On one hand we expose the store connection on DbContext.Database.Connection by design. On the other hand, we currently rely on the EntityConnection.CurrentTransaction internal property to wire up transactions to the database commands created for ObjectContext.ExecuteStoreQuery and ObjectContext.ExecuteStoreCommand, which is not set correctly by just beginning a local transaction on the underlying connection.
We potentially have worse problems on save, since we use the same EntityConnection.CurrentTransaction property to wire up the transaction used in individual commands in the update pipeline and in the logic that figures out whether we need to create our own local transaction in SaveChanges.