Bug 462379 - (NS_ERROR_FAILURE) [nsINavBookmarksService.insertBookmark] when trying to star a bookmark (r=sdwilsh, for marco, sdwilsh)
authorDietrich Ayala <dietrich@mozilla.com>
Fri, 31 Oct 2008 17:59:38 -0700
changeset 21167 944d15e482ba41fc3b8844caa581a786a959fbe5
parent 21166 0c76aa3fc8f46c0feac0f3283368c7a8b5ac3e71
child 21168 5ea477cf4e7bb08bab763b3439cd3c00d5b14511
push id3372
push userdietrich@mozilla.com
push dateSat, 01 Nov 2008 01:00:05 +0000
treeherdermozilla-central@944d15e482ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssdwilsh, for
bugs462379
milestone1.9.1b2pre
Bug 462379 - (NS_ERROR_FAILURE) [nsINavBookmarksService.insertBookmark] when trying to star a bookmark (r=sdwilsh, for marco, sdwilsh)
toolkit/components/places/src/nsPlacesDBFlush.js
--- a/toolkit/components/places/src/nsPlacesDBFlush.js
+++ b/toolkit/components/places/src/nsPlacesDBFlush.js
@@ -197,35 +197,32 @@ nsPlacesDBFlush.prototype = {
 
     let statements = [];
     for (let i = 0; i < aTableNames.length; i++)
       statements.push(this._getSyncTableStatement(aTableNames[i]));
 
     // Execute sync statements async in a transaction
     // XXX due to a bug in sqlite, we cannot wrap these in a transaction.  See
     //     https://bugzilla.mozilla.org/show_bug.cgi?id=462379#c2 for details.
-    this._db.executeAsync(statements, statements.length, this);
+    //this._db.executeAsync(statements, statements.length, this);
 
-    // XXX Disabled due to persistent test failures on the tinderbox.
-    /*
     let self = this;
     let listener = {
       // We also need to batch the two handleCompletion objects into one.
-      _count: 0,
+      _count: statements.length,
       handleError: function(aError) self.handleError(aError),
       handleCompletion: function(aReason) {
-        this._count++;
-        if (this._count == 2) {
-          // we have gotten both notifications
+        this._count--;
+        if (this._count == 0) {
+          // we have gotten all notifications
           self.handleCompletion(aReason);
         }
       }
     };
     statements.forEach(function(stmt) stmt.executeAsync(listener));
-    */
 
     // Finalize statements, otherwise we could get in trouble
     statements.forEach(function(stmt) stmt.finalize());
   },
 
   /**
    * Generate the statement to synchronizes the moz_{aTableName} and
    * moz_{aTableName}_temp by copying all the data from the temporary table