commit 6896beb0965d5cb20b60b37b96494c95b46f9147
parent 50a0b2d36c5a6b5debdf65b3647df71a94020b81
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 16 Feb 2013 23:07:47 -0500
Remove use of deprecated pragma default_cache_size
Instead, set cache_size at runtime
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
@@ -1123,6 +1123,11 @@ Zotero.DBConnection.prototype._getDBConnection = function () {
Zotero.DB.query("PRAGMA locking_mode=NORMAL");
}
+ // Set page cache size to 8MB
+ var pageSize = Zotero.DB.valueQuery("PRAGMA page_size");
+ var cacheSize = 8192000 / pageSize;
+ Zotero.DB.query("PRAGMA cache_size=" + cacheSize);
+
// Register idle and shutdown handlers to call this.observe() for DB backup
var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
.getService(Components.interfaces.nsIIdleService);
diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js
@@ -2283,11 +2283,6 @@ Zotero.Schema = new function(){
Zotero.wait();
- // Set page cache size to 8MB
- var pageSize = Zotero.DB.valueQuery("PRAGMA page_size");
- var cacheSize = 8192000 / pageSize;
- Zotero.DB.query("PRAGMA default_cache_size=" + cacheSize);
-
// Orphaned child attachment
Zotero.DB.query("UPDATE itemAttachments SET sourceItemID=NULL WHERE sourceItemID NOT IN (SELECT itemID FROM items)");
Zotero.DB.query("UPDATE itemNotes SET sourceItemID=NULL WHERE sourceItemID NOT IN (SELECT itemID FROM items)");