aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Data/BaseSqliteRepository.cs30
-rw-r--r--Emby.Server.Implementations/Emby.Server.Implementations.csproj2
-rw-r--r--Emby.Server.Implementations/packages.config2
3 files changed, 30 insertions, 4 deletions
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 @@
<Private>True</Private>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
- <HintPath>..\packages\SQLitePCLRaw.core.1.1.0\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll</HintPath>
+ <HintPath>..\packages\SQLitePCLRaw.core.1.1.1-pre20161109081005\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="UniversalDetector, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
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 @@
<package id="Emby.XmlTv" version="1.0.1" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Naming" version="1.0.2" targetFramework="portable45-net45+win8" />
<package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" />
- <package id="SQLitePCLRaw.core" version="1.1.0" targetFramework="portable45-net45+win8" />
+ <package id="SQLitePCLRaw.core" version="1.1.1-pre20161109081005" targetFramework="portable45-net45+win8" />
<package id="UniversalDetector" version="1.0.1" targetFramework="portable45-net45+win8" />
</packages> \ No newline at end of file