Tino Lange
2009-07-02 13:38:55 UTC
Hi all,
I have written a program that opens a SQLIte3 database and writes in it most
of the time via replace/update.
If I do select like (no writes, really only reads) statements from some
other process that carefully opens the database with "sqlite3_open_v2(...,
SQLITE_OPEN_READONLY, ...)" the main (writing) application might get
errcode=5 ermmsg='database is locked' errors when it tries to write while
the other application (only!) reads.
How is that possible? How to prevent?
I would expect that the reading application might (of course) sometimes get
"database is locked" errors, but the writing application should never.
[ I have also realized that the sqlite3 commandline tool uses sqlite_open()
and always opens in read/write mode. That's why I wrote my own reading
application using sqlite3_open_v2 ]
Thanks
Tino
I have written a program that opens a SQLIte3 database and writes in it most
of the time via replace/update.
If I do select like (no writes, really only reads) statements from some
other process that carefully opens the database with "sqlite3_open_v2(...,
SQLITE_OPEN_READONLY, ...)" the main (writing) application might get
errcode=5 ermmsg='database is locked' errors when it tries to write while
the other application (only!) reads.
How is that possible? How to prevent?
I would expect that the reading application might (of course) sometimes get
"database is locked" errors, but the writing application should never.
[ I have also realized that the sqlite3 commandline tool uses sqlite_open()
and always opens in read/write mode. That's why I wrote my own reading
application using sqlite3_open_v2 ]
Thanks
Tino