3 ms·
Can someone refresh my memory of how SQLite handles concurrency? Doesn't it block on writes or something? For a long time I've thought a spiritual successor to
by henning 18y ago
Can someone refresh my memory of how SQLite handles concurrency? Doesn't it block on writes or something?
For a long time I've thought a spiritual successor to Access, Filemaker, etc. based on SQLite would be a great idea.
- fendale 18y agoI think it blocks on write for 'the smallest possible time' (its does as much of the data change preparation as possible before locking the database). If you are just using it as a single user for generating excel style reports then this doesn't really matter. I have been thinking for a while that if I had to export a significant amount of data from an app for a tech savvy audience, I would probably send it out in an Sqlite DB instead of XML.
- senko 18y agoBy default it does deferred transactions (exclusive lock is only acquired when you need to commit), but if you use insert/update/delete outside a transaction, each statement is it's own transaction. Locking is database-wide, although IIRC there's some branch that can do table-level locking.
- jmtulloss 18y agoAs far as I know, SQLite's version of "table-level locking" is to put each table in a different database file and ATTACH them all to one database connection.
- eli 18y agoYes, but it's a little more involved: http://www.sqlite.org/lockingv3.html http://www.sqlite.org/lockingv3.html