U4-9201 - troubleshoot

This commit is contained in:
Stephan
2016-11-18 13:32:56 +01:00
parent 6101b4edde
commit bad0d15c1c
2 changed files with 4 additions and 1 deletions

View File

@@ -247,6 +247,7 @@ namespace Umbraco.Core.Persistence
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
LogHelper.Debug<UmbracoDatabase>("Dispose (" + InstanceSid + ").");
if (DatabaseFactory != null) DatabaseFactory.OnDispose(this);
}

View File

@@ -63,7 +63,9 @@ namespace Umbraco.Core
// after Umbraco has started there is a database in "context" and that context is
// going to stay there and never get destroyed nor reused, so we have to ensure that
// the database is disposed (which will auto-remove it from context).
ApplicationContext.Current.DatabaseContext.Database.Dispose();
var database = ApplicationContext.Current.DatabaseContext.Database;
if (database != null) // never to happen... unless in weird tests
ApplicationContext.Current.DatabaseContext.Database.Dispose();
}
/// <summary>