メモ:コネクションプールを使ってる時の SqlConnection を Close した時の内部動作

GitHub 上でコード追っかけたのでメモ
※実行してトレースしたわけでは無いので間違ってるかも

生きてる SqlTransaction があっても、Rollback 呼んでそう。

SqlConnection.Close() で SqlConnection.CloseInnerConnection()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs#L683

SqlConnection.CloseInnerConnection() で InnerConnection.CloseConnection()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs#L637

SqlClient.InnerConnection の定義
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionHelper.cs#L92

DbConnectionInternal.CloseConnection() で connectionPool.PutObject()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionInternal.cs#L270

DbConnectionPool.PutObject() で DeactivateObject()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs#L1454

DbConnectionPool.DeactiveObject() で DbConnectionInternal.DeactivateConnection()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs#L762

DbConnectionInternal.DeactiveConnection() で Deactivate()
https://github.com/dotnet/corefx/blob/v2.2.3/src/Common/src/System/Data/ProviderBase/DbConnectionInternal.cs#L241

SqlInternalConnection.Deactivate() で InternalDeactivate()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlInternalConnection.cs#L262

SqlinternalConnectionTds.InternalDeactivate() で _parse.Deactivate()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlInternalConnectionTds.cs#L768

TdsParser.Deactivate() で currentTransaction.CloseFromConnection()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs#L924

SqlInternalTransaction.CloseFromConnection() で innerConnection.ExecuteTransaction()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlInternalTransaction.cs#L253

SqlInternalConnectionTds.ExecuteTransaction() で ExecuteTransactionYukon()
https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlInternalConnectionTds.cs#L857

SqlInternalConnectionTds.ExecuteTransactionYukon() で _parser.TdsExecuteTransactionManagerRequest() https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlInternalConnectionTds.cs#L986

TdsParser.TdsExecuteTransactionManagerRequest https://github.com/dotnet/corefx/blob/v2.2.3/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs#L6608

名前に Yukon とか出てきたけど、2005 のコードネームやっけ。