-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading Error Message from Microsoft.Data.Entity.Storage.RelationalConnection.CheckForAmbientTransactions() #4147
Comments
@divega can you take a look at this one |
I think @michaelpaulus is right that the exception message is misleading: It is not that database connection won't be auto-enlisted in ambient transactions on |
@divega to see what happens with us creating the nested transaction. If it works as expected then maybe we can just remove this exception. |
Instead of checking System.Transactions.Transaction.Current and throwing an exception, couldn't you save that the transaction exists in a local field and use that so you don't create your own transaction? |
Fixed. |
When using a transaction scope around EF7, I get an exception:
I see the discussion around this on issue:
#1584
and the check-in code
9195c1a
That added:
around the opening of a connection.
The following check-in that modified the RelationalConnection class fef4009 removed this check.
In my testing I am able to use a transaction scope when I call SuppressAmbientTransactionWarning() and the connection created does enlist in the ambient transaction. This is the behavior I want, but is opposite of what the error message said.
Is there something I'm missing? Is it safe to SuppressAmbientTransactionWarning() and use the transaction scope, safe meaning you are not going to change the behavior to prevent me from using the transaction scope?
Thanks.
The text was updated successfully, but these errors were encountered: