Repository navigation
Leave the provider default when an intercepted call has no commandTimeout - #232
Open
akashchamp wants to merge 1 commit into
Open
akashchamp wants to merge 1 commit into
akashchamp wants to merge 1 commit into
Conversation
…eout The generator forwarded commandTimeout.GetValueOrDefault(), so an omitted or null timeout reached Command<T>.GetCommand as 0 and removed the provider default. Forward -1 instead, which GetCommand leaves alone; an explicit 0 still means no limit. Fixes DapperLib#229
This branch has not been deployed
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.
Fixes #229.
The generator forwarded
commandTimeout.GetValueOrDefault(), so an intercepted call with nocommandTimeout(or null) reachedCommand<TArgs>.GetCommandas 0 and replaced the provider default (the connection stringCommand Timeout, 30 s for SqlClient) with "no limit". It now forwardscommandTimeout ?? -1(or-1when the method has no such parameter), whichGetCommandalready leaves alone. An explicitcommandTimeout: 0still means no limit. The publicDapperAotExtensions.Command(...)overloads are untouched.Single and multi-mapping generators are both changed; the generated-output snapshots (including the
.netfxones, edited by hand since only net10.0 runs here) and the sample indocs/generatedcode.mdare updated.Added
SqliteTests.OmittedCommandTimeoutKeepsProviderDefault: an intercepted insert on a connection withDefaultTimeout = 1while another connection holds the write lock. It fails with the old generated code (still waiting after 30 s) and passes now withdatabase is lockedafter about a second.dotnet test test/Dapper.AOT.Test -f net10.0: 381 passed, 0 failed.