Python built-in database sqlite3, write locking problem

sqlite is a database that is easy to use on a stand-alone version. Seeing the tutorial says it allows concurrent access to queries, this is fine, but it writes locks, allowing only one thread to write at a time, so does it lock the database or only lock the corresponding table?

if there are tables An and B in a database, and one thread is writing to table A, can other threads write in table B?

Sep.18,2021

other threads cannot write on table B.
before performing a write operation, the thread writing to table A must first acquire the exclusive lock of the database, however, once it has an exclusive lock, No other lock type can coexist with it (including shared locks required for read operations). Reference:

SQLite locking mechanism-brief

Menu