diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs index 11c153e5b3..c85d042b2a 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs @@ -11,14 +11,6 @@ namespace Microsoft.Data.ProviderBase { sealed internal partial class DbConnectionPool { - partial void CheckPoolBlockingPeriod(Exception e) - { - if (!IsBlockingPeriodEnabled()) - { - throw e; - } - } - private bool IsBlockingPeriodEnabled() { var poolGroupConnectionOptions = _connectionPoolGroup.ConnectionOptions as SqlConnectionString; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs index c6f5a39693..7858adc93c 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs @@ -776,7 +776,12 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio throw; } - CheckPoolBlockingPeriod(e); +#if NETCOREAPP + if (!IsBlockingPeriodEnabled()) + { + throw; + } +#endif // Close associated Parser if connection already established. if (newObj?.IsConnectionAlive() == true) @@ -824,9 +829,6 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio return newObj; } - //This method is implemented in DbConnectionPool.NetCoreApp - partial void CheckPoolBlockingPeriod(Exception e); - private void DeactivateObject(DbConnectionInternal obj) { SqlClientEventSource.Log.TryPoolerTraceEvent(" {0}, Connection {1}, Deactivating.", ObjectID, obj.ObjectID);