Npgsql: don't create more than one DataSource#2045
Merged
unaizorrilla merged 10 commits intoXabaril:masterfrom Oct 3, 2023
Merged
Npgsql: don't create more than one DataSource#2045unaizorrilla merged 10 commits intoXabaril:masterfrom
unaizorrilla merged 10 commits intoXabaril:masterfrom
Conversation
…on : Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql, Version=7.0.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'." thrown for .NET 7 test runner
6 tasks
sungam3r
reviewed
Dec 3, 2023
Collaborator
|
Current fix looks like more a hack than general-purpose solution. |
Collaborator
Author
I agree, that is why I wrote:
Related: #2096 |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2045 +/- ##
==========================================
- Coverage 66.72% 65.78% -0.94%
==========================================
Files 262 174 -88
Lines 8439 4142 -4297
Branches 594 404 -190
==========================================
- Hits 5631 2725 -2906
+ Misses 2656 1325 -1331
+ Partials 152 92 -60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3 out of 4 DI extension methods are now ensuring that the
DataSourceis created only once (in a thread-safe way), and when it's possible they reuse the instance registered in the DI.It's not an ideal fix, because the current design still allows the users to have more than one
NpgsqlDataSourceper their app. Example:@unaizorrilla it's the fix I propose for 7.0.
For 8.0 we need to introduce a breaking change similar to what I did for the Azure clients in #2040
Contributes to #1993.