When we let EF know about the user transaction, one can use:
context.Database.UseTransaction(myTransaction). Problem is, that under the covers it looks like this:
((EntityConnection)_internalContext.ObjectContext.Connection).UseStoreTransaction(transaction);
accessing ObjectContext property may result in this context being initialized WITHOUT the transaction information. We should make sure that any time we initialize ObjectContext, when the user transaction has been passed, this information gets passed to the ObjectContext initialization pipeline.
Comments: We need to discuss this with Diego to decide if we should consider a fix in EF6.
context.Database.UseTransaction(myTransaction). Problem is, that under the covers it looks like this:
((EntityConnection)_internalContext.ObjectContext.Connection).UseStoreTransaction(transaction);
accessing ObjectContext property may result in this context being initialized WITHOUT the transaction information. We should make sure that any time we initialize ObjectContext, when the user transaction has been passed, this information gets passed to the ObjectContext initialization pipeline.
Comments: We need to discuss this with Diego to decide if we should consider a fix in EF6.