-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WAL databases and shared access discrepancy #769
Comments
I'm sorry, I have read your issue wrong.
|
What OS are you on? |
@eirnym Limbo does not plan to support multi process for now, or maybe ever. This is due to unnecessary performance burden that comes with synchronization between processes. If there is a clear use case where this is really needed, we may think about it. But for now, you will need to close limbo to open in another process. |
@pereman2 I don't ask to limbo have multiple processes, I'm asking to allow to open database in separate process while it's in WAL journal mode. I suggested a clear simplified case when it's may be needed. Writing from multiple applications may be dangerous, but reading is not. |
@LtdJorge I use macOS @krishvishal Limbo has no public option to open database in non-exclusive mode, or this option is well hidden |
I think what Pere means is that Limbo won't support having concurrent access to the same database file. So you could have multiple SQLite readers on one file, or one Limbo reader on that file. But not one Limbo reader and one SQLite reader, foe example, because of the performance impact of synchronization. That is why Limbo locks the file exclusively from the start (in supported platforms), while SQLite only locks exclusively (in memory) when writing. |
@eirnym I think you have a valid point but currently it is hard, because imagine if limbo is in the middle of writing some data to the database, then if SQLite3 tries to read from there it won't know there is another process touching it so it could read an invalid state of the database and that could be catastrophic. |
@LtdJorge this is managed by VFS setting in SQLite. |
I know what SQLite does. What we're saying is Limbo will not support as many configurations as SQLite does. One of them is multiprocess access to the same database file. |
If database is in WAL jounral mode, it's reasonably safe to write in another process to the same database using
sqlite3
and compatible libraries. When I open using limbo, it locks database for write, so it cannot be opened in another process.I often use this to monitor status written in database, e.g. when I download a long queue.
process 1: create database and set WAL:
process 2: opens same database:
when I quit both applications, files
test.db-shm
andtest.db-wal
are removed.when I opened database in
limbo
and then open the same database usingsqlite3
, insqlite3
I see following message on similar insert as shown above:The text was updated successfully, but these errors were encountered: