[tracker] libtracker-db: Enable read_uncommitted to fix locking issues



commit c2b3d337d4b0ad7d8a1af718435e546b58673485
Author: Jürg Billeter <j bitron ch>
Date:   Mon May 10 16:04:12 2010 +0200

    libtracker-db: Enable read_uncommitted to fix locking issues
    
    This fixes locking issues between long running batch transactions and
    queries. This will not cause any issues as long as we do not schedule
    updates and queries to run concurrently.

 src/libtracker-db/tracker-db-manager.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index fb3ea94..66efc03 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -267,6 +267,12 @@ 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;");
+
 	if (page_size != TRACKER_DB_PAGE_SIZE_DONT_SET) {
 		g_message ("  Setting page size to %d", page_size);
 		tracker_db_interface_execute_query (iface, NULL, "PRAGMA page_size = %d", page_size);



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