Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
- index 5b6ece1..cb3a0a1 100644
- --- a/src/libtracker-data/tracker-data-update.c
- +++ b/src/libtracker-data/tracker-data-update.c
- @@ -151,6 +151,8 @@ static TrackerDataUpdateBuffer update_buffer;
- static TrackerDataUpdateBufferResource *resource_buffer;
- static TrackerDataBlankBuffer blank_buffer;
- static time_t resource_time = 0;
- +static gint transaction_modseq = 0;
- +static gboolean has_persistent = TRUE;
- static GPtrArray *insert_callbacks = NULL;
- static GPtrArray *delete_callbacks = NULL;
- @@ -158,7 +160,7 @@ static GPtrArray *commit_callbacks = NULL;
- static GPtrArray *rollback_callbacks = NULL;
- static gint max_service_id = 0;
- static gint max_ontology_id = 0;
- -static gint max_modseq = 0;
- +static gint max_modseq = 1;
- static gint ensure_resource_id (const gchar *uri,
- gboolean *create);
- @@ -418,7 +420,7 @@ tracker_data_update_shutdown (void)
- {
- max_service_id = 0;
- max_ontology_id = 0;
- - max_modseq = 0;
- + max_modseq = 1;
- }
- static gint
- @@ -429,7 +431,7 @@ tracker_data_update_get_next_modseq (void)
- TrackerDBStatement *stmt;
- GError *error = NULL;
- - if (G_LIKELY (max_modseq != 0)) {
- + if (G_LIKELY (max_modseq != 1)) {
- return ++max_modseq;
- }
- @@ -502,7 +504,7 @@ cache_ensure_table (const gchar *table_name,
- resource_buffer->modified = TRUE;
- g_value_init (&gvalue, G_TYPE_INT64);
- - g_value_set_int64 (&gvalue, tracker_data_update_get_next_modseq ());
- + g_value_set_int64 (&gvalue, transaction_modseq);
- cache_insert_value ("rdfs:Resource", "tracker:modified", TRUE, &gvalue,
- 0,
- FALSE, FALSE, FALSE);
- @@ -552,6 +554,10 @@ cache_insert_value (const gchar *table_name,
- #endif
- property.date_time = date_time;
- + if (!transient) {
- + has_persistent = TRUE;
- + }
- +
- table = cache_ensure_table (table_name, multiple_values, transient);
- g_array_append_val (table->properties, property);
- }
- @@ -586,6 +592,10 @@ cache_delete_value (const gchar *table_name,
- #endif
- property.date_time = date_time;
- + if (!transient) {
- + has_persistent = TRUE;
- + }
- +
- table = cache_ensure_table (table_name, multiple_values, transient);
- table->delete_value = TRUE;
- g_array_append_val (table->properties, property);
- @@ -2394,6 +2404,8 @@ tracker_data_begin_transaction (GError **error)
- resource_time = time (NULL);
- + has_persistent = FALSE;
- +
- if (update_buffer.resource_cache == NULL) {
- update_buffer.resource_cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- /* used for normal transactions */
- @@ -2458,6 +2470,7 @@ tracker_data_commit_transaction (GError **error)
- }
- in_transaction = FALSE;
- + transaction_modseq = tracker_data_update_get_next_modseq ();
- in_ontology_transaction = FALSE;
- if (!in_journal_replay) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement