Remove use of deprecated pragma default_cache_size

Instead, set cache_size at runtime
This commit is contained in:
Dan Stillman 2013-02-16 23:07:47 -05:00
parent 50a0b2d36c
commit 6896beb096
2 changed files with 5 additions and 5 deletions

View file

@ -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);

View file

@ -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)");