`DbContext.Database.BeginTransaction` can't be nested?

entity-framework entity-framework-6

Question

I'm experimenting with utilising transactions in EF6 and found that the following code

using (db.Database.BeginTransaction())
{
    // something
    using (db.Database.BeginTransaction())
    {
        /// something
    }
}

throws an exception indicating this on the second begin transaction.

The connection is already in a transaction and cannot participate in another
transaction. EntityClient does not support parallel transactions.

I wouldn't want to do a concurrent transaction, whatever that would entail, on a single connection. Just a nested one, please.

Is what's happening really not supporting this, then?

1
5
6/28/2016 10:25:56 AM

Popular Answer

ZZZ_tmp
0
6/28/2016 11:37:39 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow