Firefox 锁定 places.sqlite

标签 firefox sqlite

平台:Firefox 3.6.13、Python 2.7 stackless 和 Windows 7(尚未在 Ubuntu 上测试,我会...)

我尝试使用 apsw 库:

conn = apsw.Connection( dir + profile + '/places.sqlite', apsw.SQLITE_OPEN_READONLY )

我得到了错误:

File "c:\apsw\src\statementcache.c", line 386, in sqlite3_prepare apsw.BusyError: BusyError: database is locked

我看到“SQLite 管理器”也可以在运行 Firefox 的情况下打开数据库。

我只是想打开阅读,我认为是无故障操作。而且我不能使用“SQLite 管理器”。我需要编写我的 Python(或 PHP 或 Perl)脚本。

1) Firefox 在 SQLite 文件上使用哪种类型的锁?为什么?

2) “SQLite 管理器”是如何工作的?


Q2) SQLite Manager 在 Firefox 中以 JavaScript 运行,因此它可以访问数据库。

这不是我要找的:在 Firefox 运行时读取位置的外部应用程序。

最佳答案

我不确定 Firefox 使用的锁类型,但我建议这样做:

将 Firefox 数据库文件复制到不同的临时位置并从那里读取它(这也降低了意外损坏原始文件的风险)。

我在 Firefox 3.* 上使用此方法还没有遇到问题。

关于Firefox 锁定 places.sqlite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4706537/

相关文章:

css - :target pseudo-class not working properly in firefox

android - Json从Retrofit到SQLite数据库

android - 如何打开由 eclipse(android) 形式 DDMS-->File explorer-->data--->data-->packagename-->database 生成的 .db 文件?

php - SQLite3 CASE和LIKE语句的困难

sql - CoffeeScript,寻找类似 SQL 的模块

python - 如何检查我的 sqlite 列是否不在我的数据框中?

html - margin、padding、border 都为零后还有空间吗?

css - Firefox 和 IE 的 Flex 问题

python - SessionNotCreatedException : Message: Expected browser binary location, 但无法在默认位置找到二进制文件,没有 'moz:firefoxOptions.binary'

javascript - 如何在 Firefox 扩展中以字符串形式获取页面的 html?