-
Notifications
You must be signed in to change notification settings - Fork 549
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
EF 6.5 release checklist #2237
Comments
Whoa!! Are you planning any preview releases? 🙏 |
Yes, but we haven't decided on how many there will be. |
We've just released a preview version of Microsoft.EntityFramework.SqlServer 6.5.0. Please try it and let us know if you run into any issues. |
@AndriySvyryd Amazing news, Andriy ! |
Great news for sure, but @AndriySvyryd what's the reason behind the release? Is it for |
@Bartleby2718 Yes, and some small Dependency and tooling updates |
@AndriySvyryd just wanted to let you know we've migrated from ErikEJ.EntityFramework.SqlServer to Microsoft.EntityFramework.SqlServer@6.5.0-preview2-24180-01 and have been running it in our test environments without issue. Is there an ETA at getting a released version? Thanks! |
@chandlerkent We plan to release the final version next month. It will likely be identical to 6.5.0-preview2 |
Not sure if it's the switch to Microsoft.Data.SqlClient or the switch to the new provider but in my local test migration I'm seeing queries timeout because of transactions that didn't timeout previously. I'm honestly not sure how the code as written worked in the past so something is probably behaving more correctly now but I'm not sure what. Roughly speaking (it's legacy code, not how we do it now) we have 2 DbContext instances. One is used for the data modification and the other is used for pre/post object retrieval for auditing changes. When the modification context is used in a transaction and the query to get the modified object is in the transaction block (but not part of it because it's a different connection) for comparison times out because the transaction is still open. As I typed out the above maybe previously the connection got reused more or cleaned up less and somehow the "audit" context snuck into the transaction? A pretty wild guess though, seems unlikely. |
@jons-bakerhill You post seems quite off topic here, but have you tried using 5.2.0, which has this fix? dotnet/SqlClient#2301 |
Somewhere along the way I was thinking of this as a "please try this and provide feedback" issue and lost the "checklist" part of it in my head. It's not the issue you linked though. The exceptions I'm getting are definitely code misbehaving and trying to query data that is changed in a transaction where the connection doing the query isn't part of that transaction. I'm a bit puzzled how it ever worked and thought I'd ask/note that it seems like either the new provider or the new version of EF itself seems to be "more correct" now. It could be something else entirely. |
@jons-bakerhill No problem, I prefer to get these reports now. Maybe it is a "bad behaviour" that has been fixed now, is that what you are saying? If you can provide a simple console app repro I can take a quick look, otherwise |
Yes. It will likely be a few business days (at best) for me to have time to set up a console app reproduction but I'll try to find some time to do so. |
relates to dotnet#2237
It looks like our command interceptors weren't getting added anymore (they set the transaction to READ UNCOMMITTED, so the transaction lock is ignored). We relied on having a class derived from DbConfiguration I've updated our code to add the interceptors in the API service startup code and removed the derived class. Things appear to be working fine again. |
@jons-bakerhill some sample code with your fix would be very helpful if you think this is a candidate for readme inclusion |
So did you have code like this? public class FE6CodeConfig : DbConfiguration And did you try to change to: public class FE6CodeConfig : MicrosoftSqlDbConfiguration { public FE6CodeConfig() { this.AddInterceptor(new EFCommandInterceptor()); } } |
I believe adding
So I replaced
with DbInterception.Add calls in Startup.cs
|
Thanks, but did you try deriving from MicrosoftSqlDbConfiguration ? |
I just tried again with the code below after commenting out my startup additions and it was never called.
|
Since you already have a derived DbConfiguration class, I believe you should do like this (as documented, but maybe the wording could be inproved) Or you can add the following lines to your existing DbConfiguration class: SetProviderFactory(MicrosoftSqlProviderServices.ProviderInvariantName, Microsoft.Data.SqlClient.SqlClientFactory.Instance); |
Did something get lost from the first half of your previous comment?
I'm not sure how adding lines to the derived It took a bit to click but I think what I need to do if I want to use the attribute to point the context to the new Microsoft.Data provider is to point directly to my derived class instead of the base class. That is |
You should not use the attribute in this case. Notice the Or conditions in the readme. |
MicrosoftSqlDbConfiguration is not a base class, it is just a convenince helpers. |
Inheriting from it ( My suggestion (based on what I think is finally a mostly complete understanding) would be to add a note along the lines of "If you are using a customized I have a couple options at this point, I just want to keep the configuration out of web.config to ease the migration to .Net 6+. It's just a matter of deciding which one will work best in our solution. Thank you for working through this with me, it's much appreciated! |
I think this clarification is enough, but I will test it: Or add the following lines to your existing derived DbConfiguration class: |
Oh... your prior comment #2237 (comment) makes more sense now. Without quotes or a link it wasn't clear to me that was a full quote from the readme page. I'm a little slow on the uptake today it appears, must be because it's a Monday :D |
Not sure if this is the readme to note this, but if you are using EF6.5 on .NET Core with For Azure Web Apps at least. Not sure if it's an issue for an IIS deployment. |
@3nth Please share a simple console app that demonstrates this issue, and I will have a closer look. |
relates to dotnet/ef6#2237
@ErikEJ This is looking like a peculiarity with Azure App Services. Runtime identifier does appear to be required due to the windows only libraries in With regards to
A peculiarity is we also have a None of this has been reproduceable locally. Cannot make sense of it, but we have a working deployment now. |
This seems to have been some oddity with one of the slots. deleting that slot and re-creating it seems to have cleared the issue. Nothing to do with --self-contained, it was simply failing every other deployment. |
@AndriySvyryd would you like a PR for a docs page with a readme? Are we waiting for 5.1.6? |
Yes, that would be great.
No, I don't think it will be released this month |
I see that there are two version of 6.5(6.5.0 and 6.5.1), but I can't find the change log. |
Code broke after upgrading. I have a TransactionScope (Required). The connection SHOULD and WAS held open at that point until I commit the transaction, otherwise closing the connection would end the transaction. The code is broke now and the temp table is gone, because EF did in fact close the connection and terminate the transaction, all while still in the transaction scope. It did not work this way before. This an alarming change, that completely breaks all expectations of code operating within a .NET TransactionScope. |
Wow, more issues. Are you aware that Add-Migration -Script is completely broken now in EF 6.5.1? It's just omitting large sections of Sql() calls in the migration. Literally output like 5% of the lines in the SQL script passed to the Sql method in the migration and just omitted the rest. I downgraded to 6.4.4, and it scripted all of one file, but only 5% of another file. This is insanely broken. |
It's literally outputting some of the script to the script file and the rest of the script to the package manager console. Looks like some kind of output redirection bug. Possibly even something lower-level than EF? The part that goes to the script is not in the console and vice versa. It's as if it suddenly just redirects output to the PM console instead of the script. wtf. |
The text was updated successfully, but these errors were encountered: