[tracker/binary-log-2: 4/63] libtracker-data: Use journal transactions in updates
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/binary-log-2: 4/63] libtracker-data: Use journal transactions in updates
- Date: Fri, 8 Jan 2010 09:42:46 +0000 (UTC)
commit b938252cd2f42ea0e32f798f56fefae9a7eff5c3
Author: Jürg Billeter <j bitron ch>
Date: Tue Dec 29 14:11:29 2009 +0100
libtracker-data: Use journal transactions in updates
src/libtracker-data/tracker-data-update.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index be60cb8..11f798c 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2060,12 +2060,14 @@ tracker_data_update_sparql (const gchar *update,
sparql_query = tracker_sparql_query_new_update (update);
tracker_db_interface_execute_query (iface, NULL, "SAVEPOINT sparql");
+ tracker_db_journal_start_transaction ();
tracker_sparql_query_execute_update (sparql_query, FALSE, &actual_error);
if (actual_error) {
tracker_data_update_buffer_clear ();
tracker_db_interface_execute_query (iface, NULL, "ROLLBACK TO sparql");
+ tracker_db_journal_rollback_transaction ();
if (rollback_callbacks) {
guint n;
@@ -2082,6 +2084,7 @@ tracker_data_update_sparql (const gchar *update,
return;
}
+ tracker_db_journal_commit_transaction ();
tracker_db_interface_execute_query (iface, NULL, "RELEASE sparql");
g_object_unref (sparql_query);
@@ -2104,12 +2107,14 @@ tracker_data_update_sparql_blank (const gchar *update,
sparql_query = tracker_sparql_query_new_update (update);
tracker_db_interface_execute_query (iface, NULL, "SAVEPOINT sparql");
+ tracker_db_journal_start_transaction ();
blank_nodes = tracker_sparql_query_execute_update (sparql_query, TRUE, &actual_error);
if (actual_error) {
tracker_data_update_buffer_clear ();
tracker_db_interface_execute_query (iface, NULL, "ROLLBACK TO sparql");
+ tracker_db_journal_rollback_transaction ();
if (rollback_callbacks) {
guint n;
@@ -2126,6 +2131,7 @@ tracker_data_update_sparql_blank (const gchar *update,
return NULL;
}
+ tracker_db_journal_commit_transaction ();
tracker_db_interface_execute_query (iface, NULL, "RELEASE sparql");
g_object_unref (sparql_query);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]