Bug 792833 - 'Do not unset current transaction until after savepoint has been released'. r=khuey, a=lsblakk.
authorBen Turner <bent.mozilla@gmail.com>
Thu, 20 Sep 2012 09:26:58 -0700
changeset 106936 2593ecab46c6789ff153bc3f9220464b1f2f5acf
parent 106935 117c859cfdb9285b5f82520ffbea6f817556f384
child 106937 c883a5406e872f2aea1c01f80204e56e64755790
push id2146
push userbturner@mozilla.com
push dateMon, 24 Sep 2012 16:42:12 +0000
treeherdermozilla-aurora@2593ecab46c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, lsblakk
bugs792833
milestone17.0a2
Bug 792833 - 'Do not unset current transaction until after savepoint has been released'. r=khuey, a=lsblakk.
dom/indexedDB/AsyncConnectionHelper.cpp
--- a/dom/indexedDB/AsyncConnectionHelper.cpp
+++ b/dom/indexedDB/AsyncConnectionHelper.cpp
@@ -283,28 +283,30 @@ AsyncConnectionHelper::Run()
           NS_WARNING("Failed to make savepoint!");
         }
       }
     }
 
     mResultCode = DoDatabaseWork(connection);
 
     if (mDatabase) {
-      IndexedDatabaseManager::SetCurrentWindow(nullptr);
-
       // Release or roll back the savepoint depending on the error code.
       if (hasSavepoint) {
         NS_ASSERTION(mTransaction, "Huh?!");
         if (NS_SUCCEEDED(mResultCode)) {
           mTransaction->ReleaseSavepoint();
         }
         else {
           mTransaction->RollbackSavepoint();
         }
       }
+
+      // Don't unset this until we're sure that all SQLite activity has
+      // completed!
+      IndexedDatabaseManager::SetCurrentWindow(nullptr);
     }
   }
   else {
     // NS_ERROR_NOT_AVAILABLE is our special code for "database is invalidated"
     // and we should fail with RECOVERABLE_ERR.
     if (rv == NS_ERROR_NOT_AVAILABLE) {
       mResultCode = NS_ERROR_DOM_INDEXEDDB_RECOVERABLE_ERR;
     }