aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Security/AuthenticationRepository.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-11 00:12:00 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-11 00:12:00 -0500
commita9a808a9c407a14af9e041cff20e7fe6af3e5061 (patch)
treed4ebcc94333e1b7604f3b88d4daf749cfa822dc9 /Emby.Server.Implementations/Security/AuthenticationRepository.cs
parent0c2489059d80fd5d56fc0c894cfe6e784fc685fa (diff)
fix db locking errors
Diffstat (limited to 'Emby.Server.Implementations/Security/AuthenticationRepository.cs')
-rw-r--r--Emby.Server.Implementations/Security/AuthenticationRepository.cs12
1 files changed, 6 insertions, 6 deletions
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<AuthenticationInfo>();
- 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";