Bug 792833 - 'Do not unset current transaction until after savepoint has been released'. r=khuey.
authorBen Turner <bent.mozilla@gmail.com>
Thu, 20 Sep 2012 09:26:58 -0700
changeset 107638 30ae02a8ce8cc17e39c1775a3711379766ef0d49
parent 107637 e716df0361dbc7db2faa1a4e328ec3e7f8f1ff4c
child 107639 b8397781f862d690c4731c1394fa92566a4a0bb2
push id23498
push userryanvm@gmail.com
push dateFri, 21 Sep 2012 01:27:06 +0000
treeherdermozilla-central@488beb32bca5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs792833
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 792833 - 'Do not unset current transaction until after savepoint has been released'. r=khuey.
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;
     }