commit 245954b8765c463209baee2bafe9c792ea3bed7a
parent 9c0d6069f10f041ca4341b8e5b1ad0bf489ba448
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 25 Jun 2008 00:21:37 +0000
Add extensions.zotero.dbLockExclusive pref to control SQLite exclusive locking (default true)
Set to false to allow external access while Firefox is running
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
@@ -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"]
diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js
@@ -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);