|
|
@ -56,8 +56,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|
|
|
/// Opens the connection to the database
|
|
|
|
/// Opens the connection to the database
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
public async Task Initialize(IDbConnection connection)
|
|
|
|
public async Task Initialize(IDbConnection connection, SemaphoreSlim writeLock)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
WriteLock.Dispose();
|
|
|
|
|
|
|
|
WriteLock = writeLock;
|
|
|
|
_connection = connection;
|
|
|
|
_connection = connection;
|
|
|
|
|
|
|
|
|
|
|
|
string[] queries = {
|
|
|
|
string[] queries = {
|
|
|
@ -438,18 +440,14 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|
|
|
return userData;
|
|
|
|
return userData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void CloseConnection()
|
|
|
|
protected override void Dispose(bool dispose)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_connection != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_connection.IsOpen())
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_connection.Close();
|
|
|
|
// handled by library database
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_connection.Dispose();
|
|
|
|
protected override void CloseConnection()
|
|
|
|
_connection = null;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
// handled by library database
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|