mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
fix db locking errors
This commit is contained in:
parent
0c2489059d
commit
a9a808a9c4
12 changed files with 310 additions and 217 deletions
|
|
@ -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"))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue