[tracker/error-handling: 6/6] libtracker-data: Rollback transaction on (disk-space) failure in journal replayer



commit 9f2fc62499082ad4a4be9092d2d973cbf795609f
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Feb 8 18:20:09 2011 +0100

    libtracker-data: Rollback transaction on (disk-space) failure in journal replayer

 src/libtracker-data/tracker-data-update.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 2446fc9..4f0a814 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2577,8 +2577,8 @@ tracker_data_notify_transaction (gboolean start_timer)
 	}
 }
 
-void
-tracker_data_rollback_transaction (void)
+static void
+tracker_data_rollback_journal_transaction (void)
 {
 	TrackerDBInterface *iface;
 
@@ -2596,6 +2596,12 @@ tracker_data_rollback_transaction (void)
 	}
 
 	tracker_db_interface_execute_query (iface, NULL, "PRAGMA cache_size = %d", TRACKER_DB_CACHE_SIZE_DEFAULT);
+}
+
+void
+tracker_data_rollback_transaction (void)
+{
+	tracker_data_rollback_journal_transaction ();
 	tracker_db_journal_rollback_transaction ();
 
 	if (rollback_callbacks) {
@@ -2731,6 +2737,7 @@ tracker_data_replay_journal (TrackerBusyCallback  busy_callback,
 
 			tracker_data_commit_transaction (&new_error);
 			if (new_error) {
+				tracker_data_rollback_journal_transaction ();
 				g_warning ("Journal replay error: '%s'", new_error->message);
 				g_clear_error (&new_error);
 			}



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