diff --git a/App/StackExchange.DataExplorer/Current.cs b/App/StackExchange.DataExplorer/Current.cs index 71bb9a38..c62eefb8 100644 --- a/App/StackExchange.DataExplorer/Current.cs +++ b/App/StackExchange.DataExplorer/Current.cs @@ -164,7 +164,6 @@ public static DataExplorerDatabase DB cnn = new ProfiledDbConnection(cnn, new ErrorLoggingProfiler(profiler)); } - cnn.Open(); result = DataExplorerDatabase.Create(cnn, 30); if (Context != null) { @@ -191,7 +190,7 @@ public static void DisposeDB() db?.Dispose(); Context.Items["DB"] = null; } - else + // Also clear the call context DB if we ever hit it in a background thread { var db = CallContext.GetData("DB") as DataExplorerDatabase; db?.Dispose();