Do not use ReliableCommand in the query execution service (#66)

* Do not use ReliableCommand in the query execution service.

* Fixing the logic to remove InfoMessage handlers from ReliableSqlConnection

* Adding test to query UDT
This commit is contained in:
Brian O'Neill
2016-09-26 15:42:48 -07:00
committed by GitHub
parent 5a198e3f45
commit 57278d9322
5 changed files with 73 additions and 7 deletions

View File

@@ -195,10 +195,21 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
sqlConn.GetUnderlyingConnection().InfoMessage += OnInfoMessage;
}
// We need these to execute synchronously, otherwise the user will be very unhappy
foreach (Batch b in Batches)
try
{
await b.Execute(conn, cancellationSource.Token);
// We need these to execute synchronously, otherwise the user will be very unhappy
foreach (Batch b in Batches)
{
await b.Execute(conn, cancellationSource.Token);
}
}
finally
{
if (sqlConn != null)
{
// Subscribe to database informational messages
sqlConn.GetUnderlyingConnection().InfoMessage -= OnInfoMessage;
}
}
// TODO: Close connection after eliminating using statement for above TODO