dotnet / SqlClient

Microsoft.Data.SqlClient provides database connectivity to SQL Server for .NET applications.
MIT License
857 stars 286 forks source link

Preserve distributed transactions on pooled connection reset #3019

Open mdaigle opened 17 hours ago

mdaigle commented 17 hours ago

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).

mdaigle commented 17 hours ago

/azp run

azure-pipelines[bot] commented 17 hours ago
Azure Pipelines successfully started running 1 pipeline(s).