Skip to content

Commit

Permalink
merge pool and pool identity
Browse files Browse the repository at this point in the history
  • Loading branch information
Wraith2 committed Mar 14, 2021
1 parent 884b113 commit bb03825
Show file tree
Hide file tree
Showing 15 changed files with 493 additions and 1,592 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ internal DbConnectionPool GetConnectionPool(DbConnectionFactory connectionFactor
DbConnectionPool pool = null;
if (null != _poolGroupOptions)
{
DbConnectionPoolIdentity currentIdentity = DbConnectionPoolIdentity.NoIdentity;
DbConnectionPoolIdentity currentIdentity = DbConnectionPoolIdentity.s_noIdentity;

if (_poolGroupOptions.PoolByIdentity)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
<Compile Include="..\..\src\Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContext.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContext.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContextKey.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContextKey.cs</Link>
</Compile>
Expand Down Expand Up @@ -412,7 +415,6 @@
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionFactory.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionInternal.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPool.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlAuthenticationProviderManager.cs" />
<Compile Include="Microsoft\Data\SqlClient\Server\SqlNorm.cs" />
<Compile Include="Microsoft\Data\SqlClient\Server\SqlSer.cs" />
Expand Down Expand Up @@ -586,7 +588,9 @@
<Compile Include="Microsoft\Data\SqlClient\TdsParserStateObjectFactory.Managed.cs" />
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.uap.cs" />
<Compile Include="Microsoft\Data\SqlClient\SNI\LocalDB.uap.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs" />
<Compile Include="..\..\src\Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs</Link>
</Compile>
<Compile Include="Microsoft\Data\SqlClient\TdsParser.Unix.cs" />
<Compile Include="Microsoft\Data\SqlClient\PacketHandle.Unix.cs" />
<Compile Include="Microsoft\Data\SqlClient\SessionHandle.Unix.cs" />
Expand All @@ -598,7 +602,9 @@
<Compile Include="Microsoft\Data\SqlClient\TdsParserSafeHandles.cs" />
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.Windows.cs" />
<Compile Include="Microsoft\Data\SqlClient\SNI\LocalDB.Windows.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Windows.cs" />
<Compile Include="..\..\src\Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Windows.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Windows.cs</Link>
</Compile>
<Compile Include="Microsoft\Data\SqlClient\TdsParser.Windows.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.LoadLibraryEx.cs">
<Link>Common\Interop\Windows\kernel32\Interop.LoadLibraryEx.cs</Link>
Expand Down Expand Up @@ -743,7 +749,9 @@
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetsWindows)' != 'true' AND '$(OSGroup)' != 'AnyOS'">
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs" />
<Compile Include="..\..\src\Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.Unix.cs</Link>
</Compile>
<Compile Include="Interop\SNINativeMethodWrapper.Unix.cs" />
<Compile Include="$(CommonPath)\System\Net\Security\NegotiateStreamPal.Unix.cs">
<Link>Common\System\Net\Security\NegotiateStreamPal.Unix.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,19 @@ private bool IsBlockingPeriodEnabled()
{
return true;
}
var policy = poolGroupConnectionOptions.PoolBlockingPeriod;

switch (policy)
switch (poolGroupConnectionOptions.PoolBlockingPeriod)
{
case PoolBlockingPeriod.Auto:
{
return !ADP.IsAzureSqlServerEndpoint(poolGroupConnectionOptions.DataSource);
}
return !ADP.IsAzureSqlServerEndpoint(poolGroupConnectionOptions.DataSource);
case PoolBlockingPeriod.AlwaysBlock:
{
return true; //Enabled
}
return true;
case PoolBlockingPeriod.NeverBlock:
{
return false; //Disabled
}
return false;
default:
{
//we should never get into this path.
Debug.Fail("Unknown PoolBlockingPeriod. Please specify explicit results in above switch case statement.");
return true;
}
Debug.Fail("Unknown PoolBlockingPeriod. Please specify explicit results in above switch case statement.");
return true;

}
}
}
Expand Down
Loading

0 comments on commit bb03825

Please sign in to comment.