[tracker/journal: 5/5] libtracker-data: Fix ontology transaction handling



commit f2031a0a037a8464bacf8fd2e85e2ddd090b40ac
Author: Jürg Billeter <j bitron ch>
Date:   Wed Sep 29 13:59:08 2010 +0200

    libtracker-data: Fix ontology transaction handling

 src/libtracker-data/tracker-data-manager.c |    6 ------
 src/libtracker-data/tracker-data-update.c  |    8 ++++++--
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 980a1fd..bb6a60a 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2970,12 +2970,6 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 		tracker_data_begin_ontology_transaction (NULL);
 
-		/* This _is_ an ontology transaction, it represents a change to the
-		 * ontology. We mark it up as such in the journal, so that replay_journal
-		 * can recognize it and deal with it properly. */
-
-		tracker_db_journal_start_ontology_transaction (time (NULL));
-
 		/* Get a map of tracker:Ontology v. nao:lastModified so that we can test
 		 * for all the ontology files in ontologies_dir whether the last-modified
 		 * has changed since we dealt with the file last time. */
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 8a6e88e..cea2baf 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2255,7 +2255,11 @@ tracker_data_begin_transaction (GError **error)
 	tracker_db_interface_start_transaction (iface);
 
 	if (!in_journal_replay) {
-		tracker_db_journal_start_transaction (resource_time);
+		if (in_ontology_transaction) {
+			tracker_db_journal_start_ontology_transaction (resource_time);
+		} else {
+			tracker_db_journal_start_transaction (resource_time);
+		}
 	}
 
 	iface = tracker_db_manager_get_db_interface ();
@@ -2266,8 +2270,8 @@ tracker_data_begin_transaction (GError **error)
 void
 tracker_data_begin_ontology_transaction (GError **error)
 {
-	tracker_data_begin_transaction (error);
 	in_ontology_transaction = TRUE;
+	tracker_data_begin_transaction (error);
 }
 
 void



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