4 ms·
Even in WAL mode, you can still get a SQLITE_BUSY error even when just trying to open a new connection. The application I worked on could not tolerate these bu
by platz 7y ago
Even in WAL mode, you can still get a SQLITE_BUSY error even when just trying to open a new connection. The application I worked on could not tolerate these busy exceptions so we had to acquire an exclusive global mutex before attempting to open new connections to sqlite and make sure to release it at soon as the operation was done.
- liuliu 7y agoWAL mode doesn't really have "read-only" connection (if you try to open a read-only connection by marking as READ_ONLY with sqlite_open_v2, it will error out for WAL mode). A "supposedly" read-only connection can end up doing writes for example, consolidating WAL log into the main DB file. That can cause SQLITE_BUSY errors. You pretty much have to set the sqlite_busy_timeout in any cases.