You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In npgsql/efcore.pg#3326, EFCore.PG drops a database via DROP DATABASE test WITH (FORCE); this obviously causes any pooled connections to become broken. To prevent future exceptions, the provider calls NpgsqlConnection.ClearAllPools(); this works for legacy mode, but if a data source is in use, it is not cleared.
We do have Clear() on NpgsqlDataSource, but it isn't exposed publicly - it's only used from dispose. However, dispose makes the data source unusable, which is not what's desired here - the point is only to get rid of all existing idle connections, since we know that they're broken.
Activity
Expose NpgsqlDataSource.Clear() publicly