-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Configure MARS in SqlServer #21420
Comments
Is MARS not already specified in the connection string? |
Yes, it is. I guess we can just evaluate the connection string and determine too. I don't know how we did in 2.x. |
efcore/src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs Lines 62 to 65 in 01da710
|
Note from triage: we will try bringing back the 2.2 code for this. We should also decide whether or not to assume that a provider can do MARS. |
For other providers implementing preview6, the current implementation of query splitting assumes MARS capabilities by default, and so will fail if the provider doesn't support them. To make EF Core buffer instead, create your own subclass of RelationalQueryCompilationContext (defining a factory that returns it, and registering that factory with EF Core), with the following: public override bool IsBuffering => base.IsBuffering || IsSplitQuery; Since MARS once again is an exception in the provider landscape (although it happens to be supported by Sqlite and SQL Server when enabled), I really think it would be better to not require all providers to do this - discoverability is going to be difficult, and the buffering behavior will always work across all providers, where MARS is strictly-speaking an optimization only. It seems pretty trivial for RelationalQCC to expose a hook that allows Sqlite and SQL Server to opt in, rather than forcing everyone else to opt out. /cc @lauxjpn |
Otherwise MARS is assumed by EF Core, which we don't support. See dotnet/efcore#21420
I second that. EF Core should default to the most common/reasonable approach across the provider landscape, not the SQL Server implementation. |
Since we have split queries again, SqlServer may fail without MARS.
We could add DbOption configuration for users to tell us if they have MARS on or not.
The text was updated successfully, but these errors were encountered: