aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Social/SharingRepository.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-20 22:52:58 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-20 22:52:58 -0500
commit1dc080df8ba5b9af9245788634d56cb155afd2ba (patch)
tree746452b0013f05987fa35dd404f040cca60dcf58 /Emby.Server.Implementations/Social/SharingRepository.cs
parent985c9111cf14431c3e1a1f94953a6d4422d167ee (diff)
update connections
Diffstat (limited to 'Emby.Server.Implementations/Social/SharingRepository.cs')
-rw-r--r--Emby.Server.Implementations/Social/SharingRepository.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Social/SharingRepository.cs b/Emby.Server.Implementations/Social/SharingRepository.cs
index 9065ee108..e0ee62780 100644
--- a/Emby.Server.Implementations/Social/SharingRepository.cs
+++ b/Emby.Server.Implementations/Social/SharingRepository.cs
@@ -27,6 +27,14 @@ namespace Emby.Server.Implementations.Social
{
using (var connection = CreateConnection())
{
+ connection.ExecuteAll(string.Join(";", new[]
+ {
+ "pragma default_temp_store = memory",
+ "pragma default_synchronous=Normal",
+ "pragma temp_store = memory",
+ "pragma synchronous=Normal",
+ }));
+
string[] queries = {
"create table if not exists Shares (Id GUID, ItemId TEXT, UserId TEXT, ExpirationDate DateTime, PRIMARY KEY (Id))",
@@ -50,9 +58,9 @@ namespace Emby.Server.Implementations.Social
throw new ArgumentNullException("info.Id");
}
- using (WriteLock.Write())
+ using (var connection = CreateConnection())
{
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
connection.RunInTransaction(db =>
{
@@ -75,9 +83,9 @@ namespace Emby.Server.Implementations.Social
throw new ArgumentNullException("id");
}
- using (WriteLock.Read())
+ using (var connection = CreateConnection(true))
{
- using (var connection = CreateConnection(true))
+ using (WriteLock.Read())
{
var commandText = "select Id, ItemId, UserId, ExpirationDate from Shares where id = ?";