-
Notifications
You must be signed in to change notification settings - Fork 292
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
Support Globalization Invariant Mode on alpine images #1249
Comments
I wrote up a blog post about this https://blog.wraithware.org/2020/05/23/SqlClient-and-Globalization-Invariant-mode.html |
Maybe not, but it did work pretty fine in reality :) Anyway it would be nice to not think about this and have support in the sql library. |
But you do understand that there's an easy workaround right? So the current functionality protects your data integrity and allows you to use the additional functionality if you put the underlying OS in a state where it has the support needed for the feature. |
@ilya-git Hi, This is by design. .NET Core 2.2 + EFCore 2.2.6 + Alpine works because you happen to be using compatible collations between the client and server. If they had been different, you could hit issue #81 So we added the specific exception message pointing users to the problem and solution. It would take a lot of time to identify the scenarios where the new Globalization Invariant Mode can be supported by SqlClient and target code changes specific to those scenarios. Note, it's not just at connection Open() that exceptions could occur so identifying everywhere the code would have to essentially "defend" against Globalization Invariant Mode could be very extensive. I close the issue as it is by design. Feel free to reopen if you have more to add. Also note, as an open source repository we welcome any contribution. If you can find out the possible scenarios make a PR and we will review it. |
I did not realize it's a complicated feature to add. What you say makes sense. It's just it's not that very obvious when one sees this error what should be done. Googling gives some issues in Github, so I figured what to do, but it was not straightforward. It's also possible that very many backend API's do not need globalization. Additionally maybe it's a good idea to have a separate docker build with alpine that supports this out of the box, since many use SQL client library I would assume? Or perhaps the plan to use ubuntu in these cases... Anyway, thanks for the explanation! |
Is your feature request related to a problem? Please describe.
Right now Globalization Invariant Mode is not supported by this new SQL client library on alpine images. I have used the latest
System.Data.SqlClient
before I switched toMicrosoft.Data.SqlClient
and there was no problems at all. It seems strange to me that the new library is not supporting what the older one never had troubles with.Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
I am now using this code in the docker file that is a workaround, but I would rather remove it so that both built time and the sime of the image is smaller.
Additional context
It would be very nice for developers to not use time to figure out why things suddenly stopped working after updating from the old to the new library.
Here is the reference to the issue where the correct exception message has been introduced.
The text was updated successfully, but these errors were encountered: