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:
Karl Burtram
2018-10-08 12:41:04 -07:00
committed by GitHub
parent acf7634425
commit 7c1710d396
4 changed files with 39 additions and 0 deletions

View File

@@ -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;
}
}
}
}