From a9a808a9c407a14af9e041cff20e7fe6af3e5061 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 11 Dec 2016 00:12:00 -0500 Subject: fix db locking errors --- .../Security/AuthenticationRepository.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Emby.Server.Implementations/Security/AuthenticationRepository.cs') diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs index dbda4a460..dbca4931b 100644 --- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs +++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs @@ -66,9 +66,9 @@ namespace Emby.Server.Implementations.Security cancellationToken.ThrowIfCancellationRequested(); - using (var connection = CreateConnection()) + using (WriteLock.Write()) { - using (WriteLock.Write()) + using (var connection = CreateConnection()) { connection.RunInTransaction(db => { @@ -202,9 +202,9 @@ namespace Emby.Server.Implementations.Security var list = new List(); - using (var connection = CreateConnection(true)) + using (WriteLock.Read()) { - using (WriteLock.Read()) + using (var connection = CreateConnection(true)) { using (var statement = connection.PrepareStatement(commandText)) { @@ -241,9 +241,9 @@ namespace Emby.Server.Implementations.Security throw new ArgumentNullException("id"); } - using (var connection = CreateConnection(true)) + using (WriteLock.Read()) { - using (WriteLock.Read()) + using (var connection = CreateConnection(true)) { var commandText = BaseSelectText + " where Id=@Id"; -- cgit v1.2.3