update connection pooling

This commit is contained in:
Luke Pulverenti
2016-06-11 16:12:01 -04:00
parent 96b1ddfddf
commit da6e94396f
17 changed files with 1587 additions and 1472 deletions

View File

@@ -20,9 +20,17 @@ namespace MediaBrowser.Server.Implementations.Persistence
Logger = logManager.GetLogger(GetType().Name);
}
protected Task<IDbConnection> CreateConnection(bool isReadOnly = false)
protected virtual async Task<IDbConnection> CreateConnection(bool isReadOnly = false)
{
return DbConnector.Connect(DbFilePath, false, true);
var connection = await DbConnector.Connect(DbFilePath, false, true).ConfigureAwait(false);
connection.RunQueries(new []
{
"pragma temp_store = memory"
}, Logger);
return connection;
}
private bool _disposed;