[tracker/tablelockedproblem] Trying



commit 4d9dcbcb426981fa61defc3e2fc066c9d9c4923b
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon May 3 13:22:07 2010 +0200

    Trying

 src/tracker-store/tracker-store.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/tracker-store/tracker-store.c b/src/tracker-store/tracker-store.c
index a4495d3..1f36f60 100644
--- a/src/tracker-store/tracker-store.c
+++ b/src/tracker-store/tracker-store.c
@@ -149,13 +149,11 @@ process_turtle_file_part (TrackerTurtleReader *reader, GError **error)
 	 * import to avoid this issue.
 	 */
 	
-/*  SAVEPOINTS don't seem to work well with concurrent queries. I was getting
-	SQLITE_MISUSED as result for sqlite3_step() until I removed these 
 	tracker_data_begin_transaction (&new_error);
 	if (new_error) {
 		g_propagate_error (error, new_error);
 		return FALSE;
-	} */
+	}
 
 	while (new_error == NULL && tracker_turtle_reader_next (reader, &new_error)) {
 		/* insert statement */
@@ -177,23 +175,26 @@ process_turtle_file_part (TrackerTurtleReader *reader, GError **error)
 
 		i++;
 		if (!new_error && i >= 10) {
+			tracker_data_commit_transaction (&new_error);
+			if (new_error) {
+				tracker_data_rollback_transaction ();
+				g_propagate_error (error, new_error);
+				return FALSE;
+			}
 			/* return to main loop */
 			return TRUE;
 		}
 	}
 
 	if (new_error) {
-		/* Explanation for commenting out, see above
-		 * tracker_data_rollback_transaction (); */
+		tracker_data_rollback_transaction ();
 		g_propagate_error (error, new_error);
 		return FALSE;
 	}
 
-	/* Explanation for commenting out, see above
-	 * tracker_data_commit_transaction (&new_error); */
+	tracker_data_commit_transaction (&new_error);
 	if (new_error) {
-		/* Explanation for commenting out, see above
-		 * tracker_data_rollback_transaction (); */
+		tracker_data_rollback_transaction ();
 		g_propagate_error (error, new_error);
 		return FALSE;
 	}



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