Skip to content

Commit

Permalink
Merge | DbConnectionInternal (Merge Only) (#2910)
Browse files Browse the repository at this point in the history
* Move netfx version of DbConnectionInternal.cs

* Merge the three files into the common one:
* netcore/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs
* netcore/src/Common/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs
* netfx/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs

* Ensure System.Transactions is included in the common project

* Bring in the DbConnectionPoolCounters from netfx project

* Add stubs for types used in DbConnectionInternal

* Resolve conflicts from merge file

* External changes following merge
* Just use a bool as the lock token

* Remove netcore version of the files

* Change the project files to point to the merged file (this completes the basic merge process)

* Patching up after rebase

* Adopt netfx implementation for IsEmancipated
  • Loading branch information
benrr101 authored Oct 24, 2024
1 parent 39c4604 commit ac1b3fb
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 1,015 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPool.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPool.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionInternal.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionInternal.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContext.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContext.cs</Link>
</Compile>
Expand Down Expand Up @@ -614,8 +617,7 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlDbTypeExtensions.cs">
<Link>Microsoft\Data\SqlDbTypeExtensions.cs</Link>
</Compile>

<Compile Include="Common\Microsoft\Data\ProviderBase\DbConnectionInternal.cs" />

<Compile Include="Common\System\NotImplemented.cs" />
<Compile Include="Common\System\Net\ContextFlagsPal.cs" />
<Compile Include="Common\System\Net\DebugCriticalHandleMinusOneIsInvalid.cs" />
Expand All @@ -630,7 +632,6 @@
<Compile Include="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="Interop\SNINativeMethodWrapper.Common.cs" />
<Compile Include="Microsoft\Data\Common\DbConnectionOptions.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionInternal.cs" />
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.cs" />
<Compile Include="Microsoft\Data\SqlClient\Reliability\SqlConfigurableRetryLogicManager.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SNI\ConcurrentQueueSemaphore.cs" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
<Compile Include="$(CommonSourceRoot)\Microsoft\Data\ProviderBase\DbConnectionFactory.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionFactory.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionInternal.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionInternal.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPool.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPool.cs</Link>
</Compile>
Expand All @@ -148,6 +151,9 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContextKey.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolAuthenticationContextKey.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPoolCounters.netfx.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolCounters.netfx.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\DbConnectionPoolGroup.cs">
<Link>Microsoft\Data\ProviderBase\DbConnectionPoolGroup.cs</Link>
</Compile>
Expand Down Expand Up @@ -699,8 +705,6 @@
<Compile Include="Microsoft\Data\Interop\SNINativeManagedWrapperX64.cs" />
<Compile Include="Microsoft\Data\Interop\SNINativeManagedWrapperX86.cs" />
<Compile Include="Microsoft\Data\Interop\SNINativeMethodWrapper.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionInternal.cs" />
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolCounters.cs" />
<Compile Include="Microsoft\Data\RelationshipConverter.cs" />
<Compile Include="Microsoft\Data\SqlClient\assemblycache.cs" />
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ internal void FailoverPermissionDemand()
// PREPARED COMMAND METHODS
////////////////////////////////////////////////////////////////////////////////////////

protected override object ObtainAdditionalLocksForClose()
protected override bool ObtainAdditionalLocksForClose()
{
bool obtainParserLock = !ThreadHasParserLockForClose;
Debug.Assert(obtainParserLock || _parserLock.ThreadMayHaveLock(), "Thread claims to have lock, but lock is not taken");
Expand All @@ -2345,10 +2345,9 @@ protected override object ObtainAdditionalLocksForClose()
return obtainParserLock;
}

protected override void ReleaseAdditionalLocksForClose(object lockToken)
protected override void ReleaseAdditionalLocksForClose(bool lockToken)
{
Debug.Assert(lockToken is bool, "Lock token should be boolean");
if ((bool)lockToken)
if (lockToken)
{
ThreadHasParserLockForClose = false;
_parserLock.Release();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<TargetFrameworks>net6.0;net8.0;net462</TargetFrameworks>
<RootNamespace />
</PropertyGroup>

<ItemGroup>
<Reference Include="System.Transactions" Condition="'$(TargetFramework)' == 'net462'" />
</ItemGroup>

</Project>
Loading

0 comments on commit ac1b3fb

Please sign in to comment.