Remove dbLockExclusive hidden preference
This commit is contained in:
parent
540abc70da
commit
d3ddc03dc6
2 changed files with 8 additions and 7 deletions
|
@ -23,6 +23,11 @@
|
||||||
***** END LICENSE BLOCK *****
|
***** END LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Exclusive locking mode (default) prevents access to Zotero database while Firefox is open.
|
||||||
|
// Normal mode is more convenient for development, but risks database corruption, particularly if
|
||||||
|
// the same database is accessed simultaneously by multiple Zotero instances.
|
||||||
|
const DB_LOCK_EXCLUSIVE = true;
|
||||||
|
|
||||||
Zotero.DBConnection = function(dbName) {
|
Zotero.DBConnection = function(dbName) {
|
||||||
if (!dbName) {
|
if (!dbName) {
|
||||||
throw ('DB name not provided in Zotero.DBConnection()');
|
throw ('DB name not provided in Zotero.DBConnection()');
|
||||||
|
@ -869,10 +874,9 @@ 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 hadDummyStatement = !!this._dummyStatement;
|
var hadDummyStatement = !!this._dummyStatement;
|
||||||
try {
|
try {
|
||||||
if (dbLockExclusive) {
|
if (DB_LOCK_EXCLUSIVE) {
|
||||||
this.query("PRAGMA locking_mode=NORMAL");
|
this.query("PRAGMA locking_mode=NORMAL");
|
||||||
}
|
}
|
||||||
if (hadDummyStatement) {
|
if (hadDummyStatement) {
|
||||||
|
@ -889,7 +893,7 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if (dbLockExclusive) {
|
if (DB_LOCK_EXCLUSIVE) {
|
||||||
this.query("PRAGMA locking_mode=EXCLUSIVE");
|
this.query("PRAGMA locking_mode=EXCLUSIVE");
|
||||||
}
|
}
|
||||||
if (hadDummyStatement) {
|
if (hadDummyStatement) {
|
||||||
|
@ -1183,9 +1187,7 @@ Zotero.DBConnection.prototype._getDBConnection = function () {
|
||||||
throw (e);
|
throw (e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exclusive locking mode (default) prevents access to Zotero database
|
if (DB_LOCK_EXCLUSIVE) {
|
||||||
// while Firefox is open -- normal mode is more convenient for development
|
|
||||||
if (Zotero.Prefs.get('dbLockExclusive')) {
|
|
||||||
Zotero.DB.query("PRAGMA locking_mode=EXCLUSIVE");
|
Zotero.DB.query("PRAGMA locking_mode=EXCLUSIVE");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -9,7 +9,6 @@ pref("extensions.zotero@chnm.gmu.edu.description", "chrome://zotero/locale/zoter
|
||||||
pref("extensions.zotero.useDataDir", false);
|
pref("extensions.zotero.useDataDir", false);
|
||||||
pref("extensions.zotero.dataDir", '');
|
pref("extensions.zotero.dataDir", '');
|
||||||
pref("extensions.zotero.lastDataDir", '');
|
pref("extensions.zotero.lastDataDir", '');
|
||||||
pref("extensions.zotero.dbLockExclusive", true);
|
|
||||||
pref("extensions.zotero.debug.log",false);
|
pref("extensions.zotero.debug.log",false);
|
||||||
pref("extensions.zotero.debug.stackTrace", false);
|
pref("extensions.zotero.debug.stackTrace", false);
|
||||||
pref("extensions.zotero.debug.store",false);
|
pref("extensions.zotero.debug.store",false);
|
||||||
|
|
Loading…
Reference in a new issue