mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update db locks
This commit is contained in:
parent
a9a808a9c4
commit
7669e821f1
@ -332,7 +332,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
//{
|
//{
|
||||||
// return new DummyToken();
|
// return new DummyToken();
|
||||||
//}
|
//}
|
||||||
return new WriteLockToken(obj);
|
return new ReadLockToken(obj);
|
||||||
}
|
}
|
||||||
public static IDisposable Write(this ReaderWriterLockSlim obj)
|
public static IDisposable Write(this ReaderWriterLockSlim obj)
|
||||||
{
|
{
|
||||||
|
@ -388,7 +388,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -688,7 +688,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
tuples.Add(new Tuple<BaseItem, List<Guid>, BaseItem, string>(item, ancestorIds, topParent, userdataKey));
|
tuples.Add(new Tuple<BaseItem, List<Guid>, BaseItem, string>(item, ancestorIds, topParent, userdataKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -1257,7 +1257,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
CheckDisposed();
|
CheckDisposed();
|
||||||
//Logger.Info("Retrieving item {0}", id.ToString("N"));
|
//Logger.Info("Retrieving item {0}", id.ToString("N"));
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -2083,7 +2083,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var list = new List<ChapterInfo>();
|
var list = new List<ChapterInfo>();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -2117,7 +2117,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
throw new ArgumentNullException("id");
|
throw new ArgumentNullException("id");
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -2198,7 +2198,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var index = 0;
|
var index = 0;
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -2492,7 +2492,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -2687,7 +2687,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
statementTexts.Add(commandText);
|
statementTexts.Add(commandText);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -2906,7 +2906,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var list = new List<Guid>();
|
var list = new List<Guid>();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -2977,7 +2977,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var list = new List<Tuple<Guid, string>>();
|
var list = new List<Tuple<Guid, string>>();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -3091,7 +3091,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
statementTexts.Add(commandText);
|
statementTexts.Add(commandText);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -4461,7 +4461,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var commandText = "select Guid,InheritedTags,(select group_concat(Tags, '|') from TypedBaseItems where (guid=outer.guid) OR (guid in (Select AncestorId from AncestorIds where ItemId=Outer.guid))) as NewInheritedTags from typedbaseitems as Outer where NewInheritedTags <> InheritedTags";
|
var commandText = "select Guid,InheritedTags,(select group_concat(Tags, '|') from TypedBaseItems where (guid=outer.guid) OR (guid in (Select AncestorId from AncestorIds where ItemId=Outer.guid))) as NewInheritedTags from typedbaseitems as Outer where NewInheritedTags <> InheritedTags";
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -4535,7 +4535,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
CheckDisposed();
|
CheckDisposed();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -4595,7 +4595,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var list = new List<string>();
|
var list = new List<string>();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -4636,7 +4636,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var list = new List<PersonInfo>();
|
var list = new List<PersonInfo>();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -4851,7 +4851,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
commandText += " Group By CleanValue";
|
commandText += " Group By CleanValue";
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -5030,7 +5030,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
statementTexts.Add(countText);
|
statementTexts.Add(countText);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -5253,7 +5253,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
CheckDisposed();
|
CheckDisposed();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -5340,7 +5340,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
cmdText += " order by StreamIndex ASC";
|
cmdText += " order by StreamIndex ASC";
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -5385,7 +5385,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
|
@ -188,7 +188,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -259,7 +259,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
@ -296,7 +296,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
throw new ArgumentNullException("key");
|
throw new ArgumentNullException("key");
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection(true))
|
using (var connection = CreateConnection(true))
|
||||||
{
|
{
|
||||||
@ -349,7 +349,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var list = new List<UserItemData>();
|
var list = new List<UserItemData>();
|
||||||
|
|
||||||
lock (WriteLock)
|
using (WriteLock.Write())
|
||||||
{
|
{
|
||||||
using (var connection = CreateConnection())
|
using (var connection = CreateConnection())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user