Only start dummy statement when backup completes if it was running before backup. Fixes broken upgrades in 2.1b3.
This commit is contained in:
parent
a709b779a7
commit
06e446a527
1 changed files with 7 additions and 2 deletions
|
@ -852,11 +852,14 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
|
||||||
// Turn off DB locking before backup and reenable after, since otherwise
|
// Turn off DB locking before backup and reenable after, since otherwise
|
||||||
// the lock is lost
|
// the lock is lost
|
||||||
var dbLockExclusive = Zotero.Prefs.get('dbLockExclusive');
|
var dbLockExclusive = Zotero.Prefs.get('dbLockExclusive');
|
||||||
|
var hadDummyStatement = !!this._dummyStatement;
|
||||||
try {
|
try {
|
||||||
if (dbLockExclusive) {
|
if (dbLockExclusive) {
|
||||||
Zotero.DB.query("PRAGMA locking_mode=NORMAL");
|
Zotero.DB.query("PRAGMA locking_mode=NORMAL");
|
||||||
}
|
}
|
||||||
Zotero.DB.stopDummyStatement();
|
if (hadDummyStatement) {
|
||||||
|
Zotero.DB.stopDummyStatement();
|
||||||
|
}
|
||||||
|
|
||||||
var store = Components.classes["@mozilla.org/storage/service;1"].
|
var store = Components.classes["@mozilla.org/storage/service;1"].
|
||||||
getService(Components.interfaces.mozIStorageService);
|
getService(Components.interfaces.mozIStorageService);
|
||||||
|
@ -871,7 +874,9 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
|
||||||
if (dbLockExclusive) {
|
if (dbLockExclusive) {
|
||||||
Zotero.DB.query("PRAGMA locking_mode=EXCLUSIVE");
|
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
|
// Opened database files can't be moved on Windows, so we have to skip
|
||||||
|
|
Loading…
Reference in a new issue