Fixing the bug with connections on database make restore fail (#473)

* closing the connections that don't need to be open and keeping track of the connections that should stay open
This commit is contained in:
Leila Lali
2017-10-05 20:06:31 -07:00
committed by GitHub
parent 7444939335
commit f09b9f4c30
33 changed files with 1045 additions and 287 deletions

View File

@@ -129,11 +129,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Metadata
ColumnMetadata[] metadata = null;
if (connInfo != null)
{
SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo);
TableMetadata table = new SmoMetadataFactory().GetObjectMetadata(
sqlConn, metadataParams.Schema,
metadataParams.ObjectName, objectType);
metadata = table.Columns;
using (SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo))
{
TableMetadata table = new SmoMetadataFactory().GetObjectMetadata(
sqlConn, metadataParams.Schema,
metadataParams.ObjectName, objectType);
metadata = table.Columns;
}
}
await requestContext.SendResult(new TableMetadataResult