mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
Reopen connections prior to creating query execution data readers (#704)
* Reopen connections prior to creating query execution data readers * Reopen connection if an exception was rasied executing the query * Fix unit tests
This commit is contained in:
@@ -436,6 +436,15 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
{
|
||||
ConnectionService.Instance.ChangeConnectionDatabaseContext(editorConnection.OwnerUri, newDatabaseName);
|
||||
}
|
||||
|
||||
foreach (Batch b in Batches)
|
||||
{
|
||||
if (b.HasError)
|
||||
{
|
||||
ConnectionService.EnsureConnectionIsOpen(sqlConn, forceReopen: true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user