[tracker/binary-log-2: 53/63] libtracker-data: Do not append to journal too early



commit ef5de220b5408549ad7aa745463a54aa3477b7bb
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jan 6 15:16:25 2010 +0100

    libtracker-data: Do not append to journal too early
    
    Object URI might not yet be in the database.

 src/libtracker-data/tracker-data-update.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 919a5e8..4e05812 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1517,12 +1517,6 @@ tracker_data_insert_statement_with_uri (const gchar            *graph,
 		return;
 	}
 
-	if (!in_journal_replay) {
-		tracker_db_journal_append_insert_statement_id (resource_buffer->id,
-			(prop_id != 0) ? prop_id : tracker_data_query_resource_id (predicate),
-			query_resource_id (object));
-	}
-
 	if (strcmp (predicate, RDF_PREFIX "type") == 0) {
 		/* handle rdf:type statements specially to
 		   cope with inference and insert blank rows */
@@ -1557,6 +1551,12 @@ tracker_data_insert_statement_with_uri (const gchar            *graph,
 			}
 		}
 	}
+
+	if (!in_journal_replay) {
+		tracker_db_journal_append_insert_statement_id (resource_buffer->id,
+			(prop_id != 0) ? prop_id : tracker_data_query_resource_id (predicate),
+			query_resource_id (object));
+	}
 }
 
 void
@@ -1598,12 +1598,6 @@ tracker_data_insert_statement_with_string (const gchar            *graph,
 		return;
 	}
 
-	if (!in_journal_replay) {
-		tracker_db_journal_append_insert_statement (resource_buffer->id,
-			(id != 0) ? id : tracker_data_query_resource_id (predicate),
-			object);
-	}
-
 	/* add value to metadata database */
 	cache_set_metadata_decomposed (property, object, &actual_error);
 	if (actual_error) {
@@ -1623,6 +1617,12 @@ tracker_data_insert_statement_with_string (const gchar            *graph,
 			                    delegate->user_data);
 		}
 	}
+
+	if (!in_journal_replay) {
+		tracker_db_journal_append_insert_statement (resource_buffer->id,
+			(id != 0) ? id : tracker_data_query_resource_id (predicate),
+			object);
+	}
 }
 
 static void



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