Skip to content

[9.0] Fix cloned connection ownership - #4055

Merged
roji merged 1 commit into
hotfix/9.0.5from
roji-connection-ownership-9-0
Oct 20, 2026
Merged

roji merged 1 commit into
hotfix/9.0.5from
roji-connection-ownership-9-0

Conversation

@roji

@roji roji commented Oct 20, 2026

Copy link
Copy Markdown
Member

Backports the complete merged fix from #3565 to hotfix/9.0.5, including both source commits (5202579a0c5606ccb7dda8d4b9501a50343a9b96 and aa4c6849010bcc6b6f37d15f6a75a69c576001e3).

  • Make CloneWith and both administrative-connection branches own their newly cloned connections.
  • Clear a previously configured data source when supplying a connection with an explicit ownership choice.
  • Include focused regression coverage for replacement and synchronous/asynchronous disposal, preserving caller-owned connections and data sources.

No dependency changes or unrelated database-creation cleanup changes.

Fixes #1814.

Validation: all 31 NpgsqlRelationalConnectionTest cases passed with the branch's .NET 9 SDK and VSTest configuration:

dotnet test test/EFCore.PG.Tests/EFCore.PG.Tests.csproj --filter FullyQualifiedName~NpgsqlRelationalConnectionTest --verbosity minimal

Backport the complete merged fix from #3565, including ownership for both administrative connection paths and focused regression coverage.

Co-authored-by: Marcus Bernander <marcus@bernander.se>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c793395d-a827-45c9-beb7-3e48149a14e7
@roji roji linked an issue Oct 20, 2026 that may be closed by this pull request
@roji
roji merged commit 392a314 into hotfix/9.0.5 Oct 20, 2026
9 checks passed
@roji
roji deleted the roji-connection-ownership-9-0 branch October 20, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CloneWith and CreateAdminConnection should own newly created connections

1 participant