[tracker/wal: 1/18] libtracker-data: Enable Write-Ahead Logging in SQLite



commit 0fb8f6df4b007e257c4902da95a7e129906b015d
Author: Jürg Billeter <j bitron ch>
Date:   Mon Jun 28 15:57:42 2010 +0200

    libtracker-data: Enable Write-Ahead Logging in SQLite
    
    This requires SQLite 3.7 and allows us to drop read_uncommitted.

 configure.ac                             |    3 ++-
 src/libtracker-data/tracker-db-manager.c |    6 +-----
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 906ec17..9cb7ca4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -732,8 +732,9 @@ fi
 # 3.6.11 for sqlite_backup API
 # 3.6.16 to fix test failures
 # 3.6.17 for shared cache mode with virtual tables
+# 3.7.0 for WAL
 
-SQLITE_REQUIRED=3.6.17
+SQLITE_REQUIRED=3.7.0
 
 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= $SQLITE_REQUIRED])
 AC_SUBST(SQLITE3_CFLAGS)
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 62bdc0c..05904a9 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -215,11 +215,7 @@ db_set_params (TrackerDBInterface *iface,
 	tracker_db_interface_execute_query (iface, NULL, "PRAGMA encoding = \"UTF-8\"");
 	tracker_db_interface_execute_query (iface, NULL, "PRAGMA auto_vacuum = 0;");
 
-	/* if we add direct access library (or enable running queries in parallel with updates,
-	   we need to disable read_uncommitted again
-	   however, when read_uncommitted is disabled, we need the custom page cache (wrapper)
-	   to avoid locking issues between long running batch transactions and queries */
-	tracker_db_interface_execute_query (iface, NULL, "PRAGMA read_uncommitted = True;");
+	tracker_db_interface_execute_query (iface, NULL, "PRAGMA journal_mode = WAL;");
 
 	if (page_size != TRACKER_DB_PAGE_SIZE_DONT_SET) {
 		g_message ("  Setting page size to %d", page_size);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]