mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
fix db locking errors
This commit is contained in:
@@ -188,9 +188,9 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
using (var connection = CreateConnection())
|
||||
lock (WriteLock)
|
||||
{
|
||||
using (WriteLock.Write())
|
||||
using (var connection = CreateConnection())
|
||||
{
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
@@ -259,9 +259,9 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
using (var connection = CreateConnection())
|
||||
lock (WriteLock)
|
||||
{
|
||||
using (WriteLock.Write())
|
||||
using (var connection = CreateConnection())
|
||||
{
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
@@ -296,9 +296,9 @@ namespace Emby.Server.Implementations.Data
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
|
||||
using (var connection = CreateConnection(true))
|
||||
lock (WriteLock)
|
||||
{
|
||||
using (WriteLock.Read())
|
||||
using (var connection = CreateConnection(true))
|
||||
{
|
||||
using (var statement = connection.PrepareStatement("select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where key =@Key and userId=@UserId"))
|
||||
{
|
||||
@@ -349,9 +349,9 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
var list = new List<UserItemData>();
|
||||
|
||||
using (var connection = CreateConnection())
|
||||
lock (WriteLock)
|
||||
{
|
||||
using (WriteLock.Read())
|
||||
using (var connection = CreateConnection())
|
||||
{
|
||||
using (var statement = connection.PrepareStatement("select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where userId=@UserId"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user