commit 06e446a5276e4ace27d3340c8a0c65da3bf3d159
parent a709b779a73c9395fcebaa01d187fab446bd0cce
Author: Simon Kornblith <simon@simonster.com>
Date: Fri, 14 Jan 2011 20:28:29 +0000
Only start dummy statement when backup completes if it was running before backup. Fixes broken upgrades in 2.1b3.
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
@@ -852,11 +852,14 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
// Turn off DB locking before backup and reenable after, since otherwise
// the lock is lost
var dbLockExclusive = Zotero.Prefs.get('dbLockExclusive');
+ var hadDummyStatement = !!this._dummyStatement;
try {
if (dbLockExclusive) {
Zotero.DB.query("PRAGMA locking_mode=NORMAL");
}
- Zotero.DB.stopDummyStatement();
+ if (hadDummyStatement) {
+ Zotero.DB.stopDummyStatement();
+ }
var store = Components.classes["@mozilla.org/storage/service;1"].
getService(Components.interfaces.mozIStorageService);
@@ -871,7 +874,9 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
if (dbLockExclusive) {
Zotero.DB.query("PRAGMA locking_mode=EXCLUSIVE");
}
- Zotero.DB.startDummyStatement();
+ if (hadDummyStatement) {
+ Zotero.DB.startDummyStatement();
+ }
}
// Opened database files can't be moved on Windows, so we have to skip