[tracker/miner-web-review] libtracker-data: Transaction logic in journal-replay



commit 2f497dee7610a47c9253454467f116aa4665c57d
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Mar 17 12:46:12 2010 +0100

    libtracker-data: Transaction logic in journal-replay

 src/libtracker-data/tracker-data-update.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 092559f..baa82d7 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2407,6 +2407,9 @@ tracker_data_replay_journal (GHashTable *classes,
 	static TrackerProperty *rdf_type = NULL;
 	gint last_operation_type = 0;
 
+	tracker_data_begin_transaction ();
+	in_journal_replay = TRUE;
+
 	if (!rdf_type) {
 		rdf_type = tracker_ontologies_get_property_by_uri (RDF_PREFIX "type");
 	}
@@ -2454,9 +2457,7 @@ tracker_data_replay_journal (GHashTable *classes,
 			}
 
 		} else if (type == TRACKER_DB_JOURNAL_START_TRANSACTION) {
-			tracker_data_begin_replay_transaction (tracker_db_journal_reader_get_time ());
-		} else if (type == TRACKER_DB_JOURNAL_END_TRANSACTION) {
-			tracker_data_commit_transaction ();
+			resource_time = tracker_db_journal_reader_get_time ();
 		} else if (type == TRACKER_DB_JOURNAL_INSERT_STATEMENT) {
 			GError *new_error = NULL;
 			TrackerProperty *property;
@@ -2640,4 +2641,8 @@ tracker_data_replay_journal (GHashTable *classes,
 	} else {
 		tracker_db_journal_reader_shutdown ();
 	}
+
+	in_journal_replay = FALSE;
+	tracker_data_commit_transaction ();
+
 }



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