Skip to content

[10.0] Own newly cloned connections - #4056

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

roji merged 1 commit into
hotfix/10.0.4from
roji-connection-ownership-10-0

Conversation

@roji

@roji roji commented Oct 20, 2026

Copy link
Copy Markdown
Member

Backport the complete fix from #3565 (98c429c) to hotfix/10.0.4, including both source commits.

CloneWith and both supplied-connection/data-source CreateAdminConnection paths now own their newly cloned connections. The ownership-aware WithConnection overload clears any previously configured data source so the supplied connection takes precedence.

Includes focused regression coverage for data-source replacement with either ownership choice, synchronous/asynchronous disposal of admin and cloned wrappers, and continued usability of caller-owned connections/data sources. Applies unchanged without dependency updates or unrelated database-creator/Exists changes.

Fixes #1814.

Validation: dotnet test test/EFCore.PG.Tests/EFCore.PG.Tests.csproj --filter FullyQualifiedName~NpgsqlRelationalConnectionTest --verbosity minimal — 31 passed, 0 failed, 0 skipped on .NET SDK 10.0.300 with this branch's VSTest configuration.

Backport the complete fix from #3565 (98c429c).

Fixes #1814.

Co-authored-by: Marcus Bernander <marcusber@users.noreply.github.com>
Co-authored-by: Shay Rojansky <roji@roji.org>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 42616e25-7eb1-4f77-a0e7-874b9426b276
@roji roji linked an issue Oct 20, 2026 that may be closed by this pull request
@roji
roji merged commit df25c1b into hotfix/10.0.4 Oct 20, 2026
10 checks passed
@roji
roji deleted the roji-connection-ownership-10-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