Firefox扩展SQLite - 更新/删除查询

时间:2013-02-03 20:39:46

标签: javascript sqlite firefox-addon

在我的firefox扩展中,我正在尝试创建一个Update语句,但我已经收回此错误

Error: Component returned failure code: 0x80630001 (NS_ERROR_STORAGE_BUSY) [mozIStorageConnection.executeSimpleSQL]

插入/选择语句工作正常,但更新和删除不起作用。

代码:

Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");
...
this.dbFile = FileUtils.getFile("ProfD", [Source.globalValue.DB_NAME+".sqlite"]);
this.db = Services.storage.openDatabase(this.dbFile);
...
/* #1 */
var statement = this.db.createStatement('UPDATE articles SET isRead="true" WHERE id= :row_id');
statement.params.row_id = 6643098;
statement.executeAsync(); //no errors. Nothing happening - only CPU 100% Load
//statement.execute();  //getting that  error 

/* #2 */
this.db.executeSimpleSQL('UPDATE articles SET isRead="true" WHERE id=6643098'); //getting that  error 
...

1 个答案:

答案 0 :(得分:0)

好的,我明白了。重新启动后,它开始像它一样工作。