This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
[Release/3.1] Fix wrong data blended with transactions in .NET Core #43069
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.
Ports dotnet/SqlClient#1023 to fix a critical issue that also exists in System.Data.SqlClient:
Summary
When working with delegated transactions, completing a transaction with open resultset leads to data corruption in the connection instance that's sent back to connection pool. Because connection pooling is enabled by default, it results in the pooled connection to contain stale data from old transaction.
This issue was identified in Microsoft.Data.SqlClient but was also traced back to System.Data.SqlClient oldest version in .NET Core.
Customer Impact
❗ Critical: This issue causes data corruption and leads to customers reading data from old query.
Regression?
No: The issue exists since System.Data.SqlClient v4.5.0-preview1.
It was an error that occurred during port activity of System.Data.SqlClient Transaction support from .NET Framework.
Testing
Test has been added to cover the wrong data flow.
Risk
Low: Fix matches the implementation with System.Data.SqlClient (in .NET Framework) and has been verified by various members of the community. It has also been released in Microsoft.Data.SqlClient v3.0.0-preview2.
cc: @danmoseley @saurabh500 @David-Engel