Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

[Release 3.1] Avoid enlistment of pooled connection in aborted transaction #42937

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

cheenamalhotra
Copy link
Member

Ports dotnet/SqlClient#551 and dotnet/SqlClient#543 to System.Data.SqlClient.

Summary

Fixes issue dotnet/SqlClient#237 that occurs due to driver enlisting pooled connection in stale transaction which is due abort from SysTx.Transactions on the server. This incorrect enlistment causes server to perform forth-coming operations in implicit mode, causing unwanted commits.

The fix ensures if a transaction gets aborted externally, the corresponding connection is not sent back to the pool.

Customer Impact

High This bug causes the driver to perform commits outside transaction even though client is presumably working inside a transaction. It qualifies for a security issue.

Regression?

No, this issue is reproducible with all SqlClient drivers.

Testing

This issue has not yet been reproduced in .NET Core applications but the driver behavior being same to that of .NET Framework needs to be fixed. The issue happens intermittently and is more likely to happen on SQL Server machines working in heavy load. The original issue was reproduced in WPF Client application, with failures seen intermittently. But client applications on any platform are susceptible to this issue.

Risk

Low: The fix has been verified by customers with failing use-cases, and by our teams by validating driver behavior on how it works with aborted transactions.

The scope of changes is low, and the fix has also been released in Microsoft.Data.SqlClient v1.1.1 and v2.0.0.

cc: @danmosemsft @saurabh500 @David-Engel

@cheenamalhotra cheenamalhotra added the Servicing-consider Issue for next servicing release review label Jun 23, 2020
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 25, 2020
@leecow leecow added this to the 3.1.7 milestone Jun 25, 2020
@Anipik Anipik merged commit 1026289 into dotnet:release/3.1 Jul 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants