Preserve distributed transactions on pooled connection reset#3019
Merged
mdaigle merged 11 commits intodotnet:mainfrom Jan 15, 2025
Merged
Preserve distributed transactions on pooled connection reset#3019mdaigle merged 11 commits intodotnet:mainfrom
mdaigle merged 11 commits intodotnet:mainfrom
Conversation
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3019 +/- ##
==========================================
+ Coverage 72.68% 72.70% +0.01%
==========================================
Files 283 283
Lines 58975 58976 +1
==========================================
+ Hits 42864 42876 +12
+ Misses 16111 16100 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Closed
benrr101
reviewed
Dec 3, 2024
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
...t.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/DistributedTransactionTest.Windows.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
mdaigle
commented
Dec 5, 2024
| @@ -1075,9 +1075,11 @@ private void ResetConnection() | |||
| // distributed transaction - otherwise don't reset! | |||
| if (Is2000) | |||
Contributor
Author
There was a problem hiding this comment.
Leaving Is2000 logic in place for now until we remove support for it. The fix will not apply to versions before 2000.
mdaigle
commented
Dec 6, 2024
|
|
||
| [ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), Timeout = 10000)] | ||
|
|
||
| public void Test_EnlistedTransactionPreservedWhilePooled() |
Contributor
Author
There was a problem hiding this comment.
Verified that these tests currently fail when run on main against an azure db.
paulmedynski
approved these changes
Jan 15, 2025
cheenamalhotra
approved these changes
Jan 15, 2025
mdaigle
added a commit
that referenced
this pull request
Jan 15, 2025
mdaigle
added a commit
that referenced
this pull request
Jan 15, 2025
This was referenced Jan 19, 2026
This was referenced Jan 26, 2026
This was referenced Feb 2, 2026
This was referenced Feb 10, 2026
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.
The current behavior only preserves transaction state for the root transaction. Enlisted connections that are reset will be placed in the transacted connection pool, but in some situations, will no longer participate in the transaction. The next connection to request the connection will expect it to be participating in the transaction, but actions on the connection will auto-commit.
This changes the reset logic to preserve transaction state for enlisted connections (part of a distributed transaction, but not root).