mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
removed change to connection service with fix (#2111)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user