diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-28 14:26:48 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-28 14:26:48 -0500 |
| commit | 1c52e4f51b1a9732264203fb0d987cf9752ef45b (patch) | |
| tree | c6ba5e7a6546f3fba214ddeacac2c87ce4ecb053 /Emby.Server.Implementations/Security/AuthenticationRepository.cs | |
| parent | 56b24da15165ef4c4b7107b673bab5b191d76afe (diff) | |
update transaction modes
Diffstat (limited to 'Emby.Server.Implementations/Security/AuthenticationRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Security/AuthenticationRepository.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs index 2632b9666..e498253c3 100644 --- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs +++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs @@ -50,7 +50,8 @@ namespace Emby.Server.Implementations.Security var existingColumnNames = GetColumnNames(db, "AccessTokens"); AddColumn(db, "AccessTokens", "AppVersion", "TEXT", existingColumnNames); - }); + + }, TransactionMode); } } @@ -70,9 +71,9 @@ namespace Emby.Server.Implementations.Security cancellationToken.ThrowIfCancellationRequested(); - using (WriteLock.Write()) + using (var connection = CreateConnection()) { - using (var connection = CreateConnection()) + using (WriteLock.Write()) { connection.RunInTransaction(db => { @@ -100,7 +101,8 @@ namespace Emby.Server.Implementations.Security statement.MoveNext(); } - }); + + }, TransactionMode); } } } @@ -137,9 +139,9 @@ namespace Emby.Server.Implementations.Security throw new ArgumentNullException("query"); } - using (WriteLock.Read()) + using (var connection = CreateConnection(true)) { - using (var connection = CreateConnection(true)) + using (WriteLock.Read()) { var commandText = BaseSelectText; @@ -244,9 +246,9 @@ namespace Emby.Server.Implementations.Security throw new ArgumentNullException("id"); } - using (WriteLock.Read()) + using (var connection = CreateConnection(true)) { - using (var connection = CreateConnection(true)) + using (WriteLock.Read()) { var commandText = BaseSelectText + " where Id=@Id"; |
