-
Notifications
You must be signed in to change notification settings - Fork 933
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
Add a driver to support Microsoft.Data.SqlClient provider #2216
Conversation
So for adding some context, this is about following Microsoft move on their data provider, as explained here. |
This is pity that they claim to support netstandard 2.0 while this is not true. |
Or use netstandard2.0 version of the lib.
Why it's not true? netcoreapp2.1 might have some target specific optimizations missing in netstandard2.0 |
@bahusoid everything in netstandard2.0 throwing PlatformNotSupportedException. |
It seems going to be fixed according to dotnet/SqlClient#204 (comment) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Checking the test suite, there is a number of troubles with this new data provider.
|
And allow testing it by adding its NuGet package in the test project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests now pass excepted GH1594 which is just a bad test that I am going to fix in another PR.
else | ||
connection = new SqlConnection(connectionString); | ||
connection = Sfi.ConnectionProvider.Driver.CreateConnection(); | ||
connection.ConnectionString = connectionString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Driver.CreateConnection()
should have been used from the start. It is meant for this. It just creates the connection, not doing anything else with it.
Hello everyone. I just tried to publish the master project and include it in my project. The problem is that MicrosoftDataSqlClient is not available under Nhibernate.Driver. Also, if I try to set the connection.driver_class to MicrosoftDataSqlClient it throws me an error that the driver cannot be created. Any hints? |
Yes: it is not yet released. |
You may use binaries from the CI builds if you wish. See the commits, click the green check then follow the Details link from "NHibernate (Release Package)" build. (Latest link) as of this writing.) Then login with any TeamCity account or as Guest, and go to the Artifact tabs. It will contain .Net Framework binaries and NuGet packages build from master. |
Thank's. Any idea when it will be released? |
There is no such class even on master. It's |
As @fredericDelaporte suggested, I downloaded the Nuget package and installed Nhibernate from Local. I am using the following code to configure Nhibernate: When I try to run a db select command, the following exception is thrown: |
Common... Just type it right... How come namespace become "Nhibernate.Driver"?? And avoid using strings when you can use typed values. Something like: cfg.SetProperty("connection.driver_class", typeof(MicrosoftDataSqlClientDriver).AssemblyQualifiedName); |
@bahusoid Thank you! It was a silly mistake... |
Hello guys. quick question: when will NH depend on Microsoft.Data.SqlClient instead of the System.Data.SqlClient? It's suposed to be merged, but it seems like NH's nuget package still references System.Data.SqlClient package... |
This merge here does not change anything to the existing SqlClient drivers. It adds a new one, named As this PR is in the 5.3 milestone, this also requires you to use at least a v5.3 NHibernate, currently available only as preview in the NHibernate MyGet feed. |
@fredericDelaporte, @bahusoid
I have the following config:
|
Our |
See #3258. (TLDR: use |
Thanks @fredericDelaporte, I found about the generic batcher. I tried it and exception was gone. Could you please let me know if there any performance difference While using the generic batcher? - just wondering |
That is discussed in #3258 too. We are not aware of any significant performance difference, but we have not done extensive benchmarks to check this. |
This is just a cleaned-up copy of SqlClientDriver.