while using QueryFirstOrDefaultAsync without Using block ,getting wrong result in output
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
While using QueryFirstOrDefaultAsync ,In a certain scenario where the outbound connection in Azure appservice is high , output of the query gives wrong result
Code Sample : var orderDetail = await connection.QueryFirstOrDefaultAsync(query).ConfigureAwait(true);
We are able to fix the issue after wrapping the code(connecting object) inside using block
using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
{
var orderDetail = await connection.QueryFirstOrDefaultAsync(query).ConfigureAwait(true);
}
Not sure, how disposal of connection object helped to resolve the issue
Can any one help me to find the theory behind it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the connection lifetime around SqlConnection and QueryFirstOrDefaultAsync in the Azure App Service scenario. Reproduce the reported wrong result with and without the using block, recording the query and connection conditions described in the issue. Done means establishing a minimal reproducible case and clearly documenting the cause or required connection-lifetime behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, sql
- Domain
- backend, cloud, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100