Add extensions.zotero.dbLockExclusive pref to control SQLite exclusive locking (default true)

Set to false to allow external access while Firefox is running
This commit is contained in:
Dan Stillman 2008-06-25 00:21:37 +00:00
parent 522e9ecbba
commit c9e4b7083e
2 changed files with 9 additions and 2 deletions

View File

@ -942,8 +942,14 @@ Zotero.DBConnection.prototype._getDBConnection = function () {
throw (e);
}
// Get exclusive lock on DB
Zotero.DB.query("PRAGMA locking_mode=EXCLUSIVE");
// Exclusive locking mode (default) prevents access to Zotero database
// while Firefox is open -- normal mode is more convenient for development
if (Zotero.Prefs.get('dbLockExclusive')) {
Zotero.DB.query("PRAGMA locking_mode=EXCLUSIVE");
}
else {
Zotero.DB.query("PRAGMA locking_mode=NORMAL");
}
// Register shutdown handler to call this.observe() for DB backup
var observerService = Components.classes["@mozilla.org/observer-service;1"]

View File

@ -6,6 +6,7 @@ pref("extensions.zotero@chnm.gmu.edu.description", "chrome://zotero/locale/zoter
pref("extensions.zotero.useDataDir", false);
pref("extensions.zotero.dataDir", '');
pref("extensions.zotero.lastDataDir", '');
pref("extensions.zotero.dbLockExclusive", true);
pref("extensions.zotero.debug.log",false);
pref("extensions.zotero.debug.level",5);
pref("extensions.zotero.debug.time", false);