update connections

This commit is contained in:
Luke Pulverenti
2016-11-20 22:52:58 -05:00
parent 985c9111cf
commit 1dc080df8b
12 changed files with 693 additions and 557 deletions

View File

@@ -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 = ?";