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

@@ -1049,35 +1049,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
{ {
try try
{ {
bool disconnect = false; connection.Close();
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) catch (Exception)
{ {