fix db locking errors

This commit is contained in:
Luke Pulverenti
2016-12-11 00:12:00 -05:00
parent 0c2489059d
commit a9a808a9c4
12 changed files with 310 additions and 217 deletions

View File

@@ -52,9 +52,9 @@ namespace Emby.Server.Implementations.Social
throw new ArgumentNullException("info.Id");
}
using (var connection = CreateConnection())
using (WriteLock.Write())
{
using (WriteLock.Write())
using (var connection = CreateConnection())
{
connection.RunInTransaction(db =>
{
@@ -77,9 +77,9 @@ namespace Emby.Server.Implementations.Social
throw new ArgumentNullException("id");
}
using (var connection = CreateConnection(true))
using (WriteLock.Read())
{
using (WriteLock.Read())
using (var connection = CreateConnection(true))
{
var commandText = "select Id, ItemId, UserId, ExpirationDate from Shares where id = ?";