From b18a536194c8a9a6781f3d0acfad516c6bf5a113 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 14 Jul 2011 00:28:04 +0000 Subject: [PATCH] apply patch from stella for faster sqlite reads - closes #797 --- CHANGELOG | 2 ++ plugins/input/sqlite/sqlite_types.hpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 828a9afe8..4ba14c540 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,8 @@ For a complete change history, see the SVN log. Mapnik Trunk ------------ +- SQLite Plugin: optimize io using shared cache and no mutexes (#797) + - Directly link input plugins to libmapnik to avoid having to set dlopen flags from binding languages (#790) - Throw an error during registration for fonts which Freetype2 does not report a family or style name (r2985). diff --git a/plugins/input/sqlite/sqlite_types.hpp b/plugins/input/sqlite/sqlite_types.hpp index 9e8c25cdb..47de9ba34 100644 --- a/plugins/input/sqlite/sqlite_types.hpp +++ b/plugins/input/sqlite/sqlite_types.hpp @@ -122,7 +122,8 @@ public: sqlite_connection (const std::string& file) : db_(0) { - if (sqlite3_open (file.c_str(), &db_)) + sqlite3_enable_shared_cache(1); + if (sqlite3_open_v2 (file.c_str(), &db_, SQLITE_OPEN_NOMUTEX|SQLITE_OPEN_SHAREDCACHE, 0)) { std::ostringstream s; s << "Sqlite Plugin: ";