[tracker/ttl: 1/8] libtracker-data: Rename begin_transaction to begin_db_transaction



commit dcbf08b9ff3edc4c612ed039cd43dee077f9b3d2
Author: Jürg Billeter <j bitron ch>
Date:   Wed Mar 17 17:38:11 2010 +0100

    libtracker-data: Rename begin_transaction to begin_db_transaction
    
    To avoid mixing up SQLite transactions and SPARQL transactions.

 src/libtracker-data/libtracker-data.vapi          |    4 ++--
 src/libtracker-data/tracker-data-manager.c        |   14 +++++++-------
 src/libtracker-data/tracker-data-update.c         |   16 ++++++++--------
 src/libtracker-data/tracker-data-update.h         |    6 +++---
 src/libtracker-db/tracker-db-interface.c          |    2 +-
 src/libtracker-db/tracker-db-interface.h          |    2 +-
 src/libtracker-db/tracker-db-journal.c            |    4 ++--
 src/libtracker-db/tracker-db-journal.h            |    2 +-
 src/libtracker-db/tracker-db-manager.c            |    4 ++--
 src/tracker-store/tracker-store.c                 |   16 ++++++++--------
 tests/libtracker-data/tracker-backup-test.c       |    4 ++--
 tests/libtracker-data/tracker-ontology-test.c     |    4 ++--
 tests/libtracker-data/tracker-sparql-blank-test.c |    4 ++--
 tests/libtracker-data/tracker-sparql-test.c       |    8 ++++----
 tests/libtracker-db/tracker-db-journal.c          |    6 +++---
 tests/libtracker-fts/tracker-fts-test.c           |    4 ++--
 16 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi
index 1857bfd..b9aa4d0 100644
--- a/src/libtracker-data/libtracker-data.vapi
+++ b/src/libtracker-data/libtracker-data.vapi
@@ -75,8 +75,8 @@ namespace Tracker {
 	[CCode (cheader_filename = "libtracker-data/tracker-data-query.h,libtracker-data/tracker-data-update.h")]
 	namespace Data {
 		public int query_resource_id (string uri);
-		public void begin_transaction ();
-		public void commit_transaction ();
+		public void begin_db_transaction ();
+		public void commit_db_transaction ();
 		public void delete_statement (string graph, string subject, string predicate, string object) throws DataError;
 		public void insert_statement (string graph, string subject, string predicate, string object) throws DataError;
 		public void insert_statement_with_uri (string graph, string subject, string predicate, string object) throws DataError;
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 47aab60..efc84b3 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1518,9 +1518,9 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		/* load ontology from journal into memory */
 		load_ontology_from_journal (&classes, &properties);
 
-		tracker_data_begin_replay_transaction (tracker_db_journal_reader_get_time ());
+		tracker_data_begin_db_transaction_for_replay (tracker_db_journal_reader_get_time ());
 		import_ontology_into_db (FALSE);
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 
 		tracker_db_journal_reader_shutdown ();
 
@@ -1556,7 +1556,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 			load_ontology_file_from_path (test_schema_path, &max_id, FALSE);
 		}
 
-		tracker_data_begin_transaction ();
+		tracker_data_begin_db_transaction ();
 		tracker_db_journal_start_transaction (time (NULL));
 
 		import_ontology_into_db (FALSE);
@@ -1570,8 +1570,8 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 			g_free (test_schema_path);
 		}
 
-		tracker_db_journal_commit_transaction ();
-		tracker_data_commit_transaction ();
+		tracker_db_journal_commit_db_transaction ();
+		tracker_data_commit_db_transaction ();
 
 		g_list_foreach (sorted, (GFunc) g_free, NULL);
 		g_list_free (sorted);
@@ -1595,7 +1595,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		sorted = get_ontologies (test_schema != NULL, ontologies_dir);
 
 		/* check ontology against database */
-		tracker_data_begin_transaction ();
+		tracker_data_begin_db_transaction ();
 
 		stmt = tracker_db_interface_create_statement (iface,
 		        "SELECT Resource.Uri, \"rdfs:Resource\".\"nao:lastModified\" FROM \"tracker:Ontology\""
@@ -1690,7 +1690,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 			g_list_free (to_reload);
 		}
 
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 
 		g_hash_table_unref (ontos_table);
 
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 9c308e1..dc4c1cb 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2016,7 +2016,7 @@ tracker_data_update_disable_all_volumes (void)
 }
 
 void
-tracker_data_begin_transaction (void)
+tracker_data_begin_db_transaction (void)
 {
 	TrackerDBInterface *iface;
 
@@ -2045,15 +2045,15 @@ tracker_data_begin_transaction (void)
 }
 
 void
-tracker_data_begin_replay_transaction (time_t time)
+tracker_data_begin_db_transaction_for_replay (time_t time)
 {
 	in_journal_replay = TRUE;
-	tracker_data_begin_transaction ();
+	tracker_data_begin_db_transaction ();
 	resource_time = time;
 }
 
 void
-tracker_data_commit_transaction (void)
+tracker_data_commit_db_transaction (void)
 {
 	TrackerDBInterface *iface;
 
@@ -2076,7 +2076,7 @@ tracker_data_commit_transaction (void)
 
 	iface = tracker_db_manager_get_db_interface ();
 
-	tracker_db_interface_end_transaction (iface);
+	tracker_db_interface_end_db_transaction (iface);
 
 	g_hash_table_remove_all (update_buffer.resources);
 	g_hash_table_remove_all (update_buffer.resources_by_id);
@@ -2363,7 +2363,7 @@ update_sparql (const gchar  *update,
 		return NULL;
 	}
 
-	tracker_db_journal_commit_transaction ();
+	tracker_db_journal_commit_db_transaction ();
 	resource_time = 0;
 	tracker_db_interface_execute_query (iface, NULL, "RELEASE sparql");
 
@@ -2406,7 +2406,7 @@ tracker_data_replay_journal (GHashTable *classes,
 	static TrackerProperty *rdf_type = NULL;
 	gint last_operation_type = 0;
 
-	tracker_data_begin_replay_transaction (0);
+	tracker_data_begin_db_transaction_for_replay (0);
 
 	if (!rdf_type) {
 		rdf_type = tracker_ontologies_get_property_by_uri (RDF_PREFIX "type");
@@ -2647,6 +2647,6 @@ tracker_data_replay_journal (GHashTable *classes,
 		tracker_db_journal_reader_shutdown ();
 	}
 
-	tracker_data_commit_transaction ();
+	tracker_data_commit_db_transaction ();
 
 }
diff --git a/src/libtracker-data/tracker-data-update.h b/src/libtracker-data/tracker-data-update.h
index 7b4d7e9..5df5d08 100644
--- a/src/libtracker-data/tracker-data-update.h
+++ b/src/libtracker-data/tracker-data-update.h
@@ -77,9 +77,9 @@ void     tracker_data_insert_statement_with_string  (const gchar               *
                                                      const gchar               *predicate,
                                                      const gchar               *object,
                                                      GError                   **error);
-void     tracker_data_begin_transaction             (void);
-void     tracker_data_begin_replay_transaction      (time_t                     time);
-void     tracker_data_commit_transaction            (void);
+void     tracker_data_begin_db_transaction          (void);
+void     tracker_data_begin_db_transaction_for_replay (time_t                   time);
+void     tracker_data_commit_db_transaction         (void);
 void     tracker_data_update_sparql                 (const gchar               *update,
                                                      GError                   **error);
 GPtrArray *
diff --git a/src/libtracker-db/tracker-db-interface.c b/src/libtracker-db/tracker-db-interface.c
index 6113c26..c4215e3 100644
--- a/src/libtracker-db/tracker-db-interface.c
+++ b/src/libtracker-db/tracker-db-interface.c
@@ -364,7 +364,7 @@ tracker_db_interface_start_transaction (TrackerDBInterface *interface)
 }
 
 gboolean
-tracker_db_interface_end_transaction (TrackerDBInterface *interface)
+tracker_db_interface_end_db_transaction (TrackerDBInterface *interface)
 {
 	gboolean in_transaction;
 	GError *error = NULL;
diff --git a/src/libtracker-db/tracker-db-interface.h b/src/libtracker-db/tracker-db-interface.h
index a8d0513..f83157f 100644
--- a/src/libtracker-db/tracker-db-interface.h
+++ b/src/libtracker-db/tracker-db-interface.h
@@ -149,7 +149,7 @@ TrackerDBResultSet *tracker_db_interface_execute_query     (TrackerDBInterface
                                                             ...) G_GNUC_PRINTF (3, 4);
 
 gboolean            tracker_db_interface_start_transaction (TrackerDBInterface  *interface);
-gboolean            tracker_db_interface_end_transaction   (TrackerDBInterface  *interface);
+gboolean            tracker_db_interface_end_db_transaction   (TrackerDBInterface  *interface);
 void                tracker_db_statement_bind_double       (TrackerDBStatement  *stmt,
                                                             int                  index,
                                                             double               value);
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 17ec6d6..347942e 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -332,7 +332,7 @@ tracker_db_journal_start_transaction (time_t time)
 
 	/* Leave space for size, amount and crc
 	 * Check and keep in sync the offset variable at
-	 * tracker_db_journal_commit_transaction too */
+	 * tracker_db_journal_commit_db_transaction too */
 
 	memset (writer.cur_block, 0, size);
 
@@ -552,7 +552,7 @@ tracker_db_journal_truncate (gsize new_size)
 }
 
 gboolean
-tracker_db_journal_commit_transaction (void)
+tracker_db_journal_commit_db_transaction (void)
 {
 	guint32 crc;
 	guint begin_pos;
diff --git a/src/libtracker-db/tracker-db-journal.h b/src/libtracker-db/tracker-db-journal.h
index 0710c52..7819bc5 100644
--- a/src/libtracker-db/tracker-db-journal.h
+++ b/src/libtracker-db/tracker-db-journal.h
@@ -73,7 +73,7 @@ gboolean     tracker_db_journal_append_resource              (gint         s_id,
                                                               const gchar *uri);
 
 gboolean     tracker_db_journal_rollback_transaction         (void);
-gboolean     tracker_db_journal_commit_transaction           (void);
+gboolean     tracker_db_journal_commit_db_transaction           (void);
 
 gboolean     tracker_db_journal_fsync                        (void);
 gboolean     tracker_db_journal_truncate                     (gsize new_size);
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index be58a50..704062b 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -971,7 +971,7 @@ db_interface_get_contents (void)
 	if (create) {
 		tracker_db_interface_start_transaction (iface);
 		load_sql_file (iface, "sqlite-contents.sql", NULL);
-		tracker_db_interface_end_transaction (iface);
+		tracker_db_interface_end_db_transaction (iface);
 	}
 
 	tracker_db_interface_sqlite_create_function (iface,
@@ -1002,7 +1002,7 @@ db_interface_get_metadata (void)
 		/* Create tables */
 		load_sql_file (iface, "sqlite-tracker.sql", NULL);
 
-		tracker_db_interface_end_transaction (iface);
+		tracker_db_interface_end_db_transaction (iface);
 	}
 
 	return iface;
diff --git a/src/tracker-store/tracker-store.c b/src/tracker-store/tracker-store.c
index 2af72d0..488b4e2 100644
--- a/src/tracker-store/tracker-store.c
+++ b/src/tracker-store/tracker-store.c
@@ -142,7 +142,7 @@ begin_batch (TrackerStorePrivate *private)
 	if (!private->batch_mode) {
 		/* switch to batch mode
 		   delays database commits to improve performance */
-		tracker_data_begin_transaction ();
+		tracker_data_begin_db_transaction ();
 		private->batch_mode = TRUE;
 		private->batch_count = 0;
 	}
@@ -153,7 +153,7 @@ end_batch (TrackerStorePrivate *private)
 {
 	if (private->batch_mode) {
 		/* commit pending batch items */
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 
 		private->batch_mode = FALSE;
 		private->batch_count = 0;
@@ -413,14 +413,14 @@ tracker_store_sparql_update (const gchar *sparql,
 
 	if (private->batch_mode) {
 		/* commit pending batch items */
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 		private->batch_mode = FALSE;
 		private->batch_count = 0;
 	}
 
-	tracker_data_begin_transaction ();
+	tracker_data_begin_db_transaction ();
 	tracker_data_update_sparql (sparql, error);
-	tracker_data_commit_transaction ();
+	tracker_data_commit_db_transaction ();
 
 }
 
@@ -438,14 +438,14 @@ tracker_store_sparql_update_blank (const gchar *sparql,
 
 	if (private->batch_mode) {
 		/* commit pending batch items */
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 		private->batch_mode = FALSE;
 		private->batch_count = 0;
 	}
 
-	tracker_data_begin_transaction ();
+	tracker_data_begin_db_transaction ();
 	blank_nodes = tracker_data_update_sparql_blank (sparql, error);
-	tracker_data_commit_transaction ();
+	tracker_data_commit_db_transaction ();
 
 	return blank_nodes;
 }
diff --git a/tests/libtracker-data/tracker-backup-test.c b/tests/libtracker-data/tracker-backup-test.c
index 582b586..aabf368 100644
--- a/tests/libtracker-data/tracker-backup-test.c
+++ b/tests/libtracker-data/tracker-backup-test.c
@@ -100,9 +100,9 @@ test_backup_and_restore (void)
 	/* load data set */
 	data_filename = g_strconcat (data_prefix, ".data", NULL);
 	if (g_file_test (data_filename, G_FILE_TEST_IS_REGULAR)) {
-		tracker_data_begin_transaction ();
+		tracker_data_begin_db_transaction ();
 		tracker_turtle_reader_load (data_filename, &error);
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 		g_assert_no_error (error);
         } else {
                 g_assert_not_reached ();
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index f3a5080..f2b8a5a 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -100,9 +100,9 @@ test_query (gconstpointer test_data)
 
 	/* load data set */
 	data_filename = g_strconcat (data_prefix, ".ttl", NULL);
-	tracker_data_begin_transaction ();
+	tracker_data_begin_db_transaction ();
 	tracker_turtle_reader_load (data_filename, &error);
-	tracker_data_commit_transaction ();
+	tracker_data_commit_db_transaction ();
 	g_assert_no_error (error);
 
 	query_filename = g_strconcat (test_prefix, ".rq", NULL);
diff --git a/tests/libtracker-data/tracker-sparql-blank-test.c b/tests/libtracker-data/tracker-sparql-blank-test.c
index 02b3c06..4490625 100644
--- a/tests/libtracker-data/tracker-sparql-blank-test.c
+++ b/tests/libtracker-data/tracker-sparql-blank-test.c
@@ -48,12 +48,12 @@ test_blank (void)
 
 	/* perform update in transaction */
 
-	tracker_data_begin_transaction ();
+	tracker_data_begin_db_transaction ();
 	updates = tracker_data_update_sparql_blank (
 	                                            "INSERT { _:foo a rdfs:Resource } "
 	                                            "INSERT { _:foo a rdfs:Resource . _:bar a rdfs:Resource } ",
 	                                            &error);
-	tracker_data_commit_transaction ();
+	tracker_data_commit_db_transaction ();
 	g_assert_no_error (error);
 
 	g_assert_cmpint (updates->len, ==, 2);
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 68c798a..fbcb2ad 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -133,9 +133,9 @@ test_sparql_query (gconstpointer test_data)
 	/* load data set */
 	data_filename = g_strconcat (data_prefix, ".ttl", NULL);
 	if (g_file_test (data_filename, G_FILE_TEST_IS_REGULAR)) {
-		tracker_data_begin_transaction ();
+		tracker_data_begin_db_transaction ();
 		tracker_turtle_reader_load (data_filename, &error);
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 		g_assert_no_error (error);
 	} else {
 		/* no .ttl available, assume .rq with SPARQL Update */
@@ -147,9 +147,9 @@ test_sparql_query (gconstpointer test_data)
 		g_file_get_contents (data_filename, &data, NULL, &error);
 		g_assert_no_error (error);
 
-		tracker_data_begin_transaction ();
+		tracker_data_begin_db_transaction ();
 		tracker_data_update_sparql (data, &error);
-		tracker_data_commit_transaction ();
+		tracker_data_commit_db_transaction ();
 		g_assert_no_error (error);
 
 		g_free (data);
diff --git a/tests/libtracker-db/tracker-db-journal.c b/tests/libtracker-db/tracker-db-journal.c
index 581c8c3..fe45cf8 100644
--- a/tests/libtracker-db/tracker-db-journal.c
+++ b/tests/libtracker-db/tracker-db-journal.c
@@ -89,7 +89,7 @@ test_write_functions (void)
 	g_assert_cmpint (result, ==, TRUE);
 	result = tracker_db_journal_append_delete_statement_id (0, 12, 13, 14);
 	g_assert_cmpint (result, ==, TRUE);
-	result = tracker_db_journal_commit_transaction ();
+	result = tracker_db_journal_commit_db_transaction ();
 	g_assert_cmpint (result, ==, TRUE);
 	actual_size = tracker_db_journal_get_size ();
 	g_assert_cmpint (initial_size, !=, actual_size);
@@ -103,7 +103,7 @@ test_write_functions (void)
 	g_assert_cmpint (result, ==, TRUE);
 	result = tracker_db_journal_append_insert_statement (0, 15, 16, "test");
 	g_assert_cmpint (result, ==, TRUE);
-	result = tracker_db_journal_commit_transaction ();
+	result = tracker_db_journal_commit_db_transaction ();
 	g_assert_cmpint (result, ==, TRUE);
 
 	/* Test insert id */
@@ -117,7 +117,7 @@ test_write_functions (void)
 	g_assert_cmpint (result, ==, TRUE);
 	result = tracker_db_journal_append_insert_statement_id (0, 17, 18, 19);
 	g_assert_cmpint (result, ==, TRUE);
-	result = tracker_db_journal_commit_transaction ();
+	result = tracker_db_journal_commit_db_transaction ();
 	g_assert_cmpint (result, ==, TRUE);
 
 	/* Test fsync */
diff --git a/tests/libtracker-fts/tracker-fts-test.c b/tests/libtracker-fts/tracker-fts-test.c
index b065c61..adb5000 100644
--- a/tests/libtracker-fts/tracker-fts-test.c
+++ b/tests/libtracker-fts/tracker-fts-test.c
@@ -80,9 +80,9 @@ test_sparql_query (gconstpointer test_data)
 	g_file_get_contents (update_filename, &update, NULL, &error);
 	g_assert_no_error (error);
 
-	tracker_data_begin_transaction ();
+	tracker_data_begin_db_transaction ();
 	tracker_data_update_sparql (update, &error);
-	tracker_data_commit_transaction ();
+	tracker_data_commit_db_transaction ();
 	g_assert_no_error (error);
 
 	g_free (update_filename);



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