|
|
|
|
|
by znpy
486 days ago
|
|
> This means you have to intentionally think about handling it everywhere if you want to use another connection anywhere. so things like mutexes (one process, multiple threads) or mutexes over shared memory (multiple processes, multiple threads) ? sounds complicated (and error-prone). but at the end of the day i guess that kind of juggling has to be done somewhere, either a database server does it for you or you do it yourself in the database client. i wouldn't mind sqlite on the server, but i'm not sure I would want to trade zero-downtime-deployments (spin up new version, move load from old to new, spin down old version) for single-file ease of operations. |
|
It's handled by the file lock. You don't need to track anything.
Yes there is a timeout value that will return an error if the database file hasn't unlocked in time. In Python the default timeout is 5 seconds, which is plenty if your queries execute on the order of milliseconds or tens of milliseconds.