aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteUserRepository.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-11-21 12:29:18 -0500
committerGitHub <noreply@github.com>2016-11-21 12:29:18 -0500
commitf80cc1bbd4145a682234d4d1d286c70f562f36bd (patch)
tree2ecc0e11aa1f394295f6269069da5ed6b9ed0667 /Emby.Server.Implementations/Data/SqliteUserRepository.cs
parentb2ea3272e70a0f520133ee6a74d958e044d4392e (diff)
parent1acebd992229ee9bd6e7677f68174672fae53622 (diff)
Merge pull request #2299 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteUserRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteUserRepository.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteUserRepository.cs b/Emby.Server.Implementations/Data/SqliteUserRepository.cs
index 5e148d95a..f902d981f 100644
--- a/Emby.Server.Implementations/Data/SqliteUserRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteUserRepository.cs
@@ -50,6 +50,13 @@ namespace Emby.Server.Implementations.Data
{
using (var connection = CreateConnection())
{
+ connection.ExecuteAll(string.Join(";", new[]
+ {
+ "PRAGMA page_size=4096",
+ "pragma default_temp_store = memory",
+ "pragma temp_store = memory"
+ }));
+
string[] queries = {
"create table if not exists users (guid GUID primary key, data BLOB)",
@@ -83,9 +90,9 @@ namespace Emby.Server.Implementations.Data
cancellationToken.ThrowIfCancellationRequested();
- using (WriteLock.Write())
+ using (var connection = CreateConnection())
{
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
connection.RunInTransaction(db =>
{
@@ -108,9 +115,9 @@ namespace Emby.Server.Implementations.Data
{
var list = new List<User>();
- using (WriteLock.Read())
+ using (var connection = CreateConnection(true))
{
- using (var connection = CreateConnection(true))
+ using (WriteLock.Read())
{
foreach (var row in connection.Query("select guid,data from users"))
{
@@ -146,9 +153,9 @@ namespace Emby.Server.Implementations.Data
cancellationToken.ThrowIfCancellationRequested();
- using (WriteLock.Write())
+ using (var connection = CreateConnection())
{
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
connection.RunInTransaction(db =>
{