Avoid explicit cancellation in single-row cleanup - #2220
Open
HengYpinn wants to merge 1 commit into
Open
Conversation
HengYpinn
marked this pull request as ready for review
August 12, 2026 08:16
HengYpinn
force-pushed
the
fix/query-row-provider-neutral-cleanup
branch
from
August 12, 2026 08:20
31698f7 to
5331cff
Compare
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.
Summary
IDbCommand.Cancel()from synchronous single-row query cleanupQuerySinglefailuresRoot cause
QueryRowImplexplicitly cancelled an open reader whenever the method exited through an exception. This differs fromQueryRowAsync, which relies on reader disposal. Some providers treat cancellation as a separate server operation; Oracle can surface ORA-01013 and obscure the meaningful zero-row or multiple-row exception.Reader disposal is the provider-owned cleanup mechanism and keeps this path provider-neutral. Other command ownership paths, including unbuffered queries and
QueryMultiple, are unchanged.User impact
Single-row query failures retain their expected exception semantics without triggering provider-specific cancellation behavior. Resource cleanup remains intact.
Validation
dotnet build Build.csproj -c Release /p:CI=true --no-restoresucceedsFixes #2215