removed change to connection service with fix (#2111)

This commit is contained in:
Alex Ma
2023-06-20 20:21:07 -07:00
committed by GitHub
parent 272d2fdb92
commit 532f7b0912

View File

@@ -1048,37 +1048,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
foreach (DbConnection connection in connectionsToDisconnect)
{
try
{
bool disconnect = false;
if (connection.ConnectionString != null)
{
int totalCount = 0;
foreach (KeyValuePair<string, ConnectionInfo> entry in OwnerToConnectionMap)
{
foreach (DbConnection value in entry.Value.AllConnections)
{
if (value.ConnectionString == connection.ConnectionString)
{
totalCount++;
}
}
}
if (totalCount == 1)
{
disconnect = true;
}
}
else
{
disconnect = true;
}
if (disconnect)
{
connection.Close();
}
}
catch (Exception)
{
// Ignore