aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-11 01:47:54 -0500
committerGitHub <noreply@github.com>2016-12-11 01:47:54 -0500
commit446b2e29d086a44548b585ea9c66d0ab4c1675eb (patch)
tree4a594ff21204a6cd4df05d3550f869d47eaa8a77 /Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
parent56ba0c5b5d0ecc6b3dc695af8efeb12465ac44d3 (diff)
parenta8d9a3440d0143aa7cf564f21aff2eadc4b88e6a (diff)
Merge pull request #2336 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteUserDataRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteUserDataRepository.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
index b65e5d1b3..be59d71b3 100644
--- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
@@ -188,9 +188,9 @@ namespace Emby.Server.Implementations.Data
{
cancellationToken.ThrowIfCancellationRequested();
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
- 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())
+ using (WriteLock.Write())
{
- 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))
+ using (WriteLock.Read())
{
- 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())
+ using (WriteLock.Read())
{
- 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"))
{