From ffb1ec76a785cdd2aef8ccbe8125a1f765559b15 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Nov 2016 02:51:07 -0500 Subject: update components --- .../Data/BaseSqliteRepository.cs | 30 ++++++++++++++++++++-- .../Emby.Server.Implementations.csproj | 2 +- Emby.Server.Implementations/packages.config | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index c47a534d1..5a4846ccf 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using MediaBrowser.Model.Logging; using SQLitePCL.pretty; using System.Linq; +using SQLitePCL; namespace Emby.Server.Implementations.Data { @@ -24,12 +25,20 @@ namespace Emby.Server.Implementations.Data get { return true; } } - protected virtual SQLiteDatabaseConnection CreateConnection(bool isReadOnly = false) + static BaseSqliteRepository() { SQLite3.EnableSharedCache = false; + int rc = raw.sqlite3_config(raw.SQLITE_CONFIG_MEMSTATUS, 0); + //CheckOk(rc); + } + + protected virtual SQLiteDatabaseConnection CreateConnection(bool isReadOnly = false) + { ConnectionFlags connectionFlags; + //isReadOnly = false; + if (isReadOnly) { connectionFlags = ConnectionFlags.ReadOnly; @@ -70,10 +79,27 @@ namespace Emby.Server.Implementations.Data //} db.ExecuteAll(string.Join(";", queries)); - + return db; } + internal static void CheckOk(int rc) + { + string msg = ""; + + if (raw.SQLITE_OK != rc) + { + throw CreateException((ErrorCode)rc, msg); + } + } + + internal static Exception CreateException(ErrorCode rc, string msg) + { + var exp = new Exception(msg); + + return exp; + } + private bool _disposed; protected void CheckDisposed() { diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 973576a0d..48b598732 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -315,7 +315,7 @@ True - ..\packages\SQLitePCLRaw.core.1.1.0\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll + ..\packages\SQLitePCLRaw.core.1.1.1-pre20161109081005\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll True diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index 519e4a0ad..5d75af7a2 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file -- cgit v1.2.3