Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox locks places.sqlite

Tags:

sqlite

firefox

Platform: Firefox 3.6.13, Python 2.7 stackless, and Windows 7 (not yet tested on Ubuntu, I will...)

I tried with the apsw library:

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

And I got the error:

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

I see "SQLite manager" can open the database also with Firefox running.

I just want to open and read, I think a trouble free operation. And I cannot use "SQLite manager". I need to code my Python (or PHP or Perl) script.

1) Which type of lock does Firefox use on the SQLite file? Why?

2) How does "SQLite manager" work?


Q2) SQLite Manager works in JavaScript, inside Firefox, so it can access the database.

This is not what I am looking for: An external application reading places while Firefox is running.

like image 290
Massimo Avatar asked Jan 16 '11 16:01

Massimo


1 Answers

I am not sure about the lock type Firefox uses, but I'd recommend this:

Copy the Firefox database file to a different temporary location and read it from there (this also lowers the risk of accidentally damaging the original file).

I haven't had problems with this method yet on Firefox 3.*.

like image 56
Amos Avatar answered Oct 15 '22 16:10

Amos