Fix Ops Studio issue 97 where query connection is dropped (#549)

- Fixes https://github.com/Microsoft/sqlopsstudio/issues/97.
- This should fix the bulk of the issues reported by users since it's the 1st use of this connection in the query code path.
- Implemented the fix in the connection service. This will always open a connection when calling `GetOrOpenConnection`. I cannot see a reason why the connection returned from this should ever be closed.
- resolve issues in both this code path and the edit data code path since both use this method.
This commit is contained in:
Kevin Cunnane
2017-11-21 14:46:20 -08:00
committed by GitHub
parent c512d53caa
commit 42ee96f99f
5 changed files with 105 additions and 39 deletions

View File

@@ -233,7 +233,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
var result = Task.Run(() => testService.Script(requestParams));
ScriptingProgressNotificationParams progressParams = await testService.Driver.WaitForEvent(ScriptingProgressNotificationEvent.Type, TimeSpan.FromSeconds(10));
Task.Run(() => testService.CancelScript(progressParams.OperationId));
Task.Run(() => testService.CancelScript(progressParams.OperationId).Wait());
ScriptingCompleteParams cancelEvent = await testService.Driver.WaitForEvent(ScriptingCompleteEvent.Type, TimeSpan.FromSeconds(10));
Assert.True(cancelEvent.Canceled);
}