U4-9201 - troubleshoot
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user