Not necessary. If sqlite3 is compiled using the thread safety macro (check via function
int sqlite3_threadsafe (void)
), you can try to access the same database from multiple threads without risk of damage. However, depending on the required locks, you may or may not really change the data (I do not believe sqlite3 supports row locking, which means that you will need to lock the table for writing). However, you can try; if one thread blocks, then it will automatically write as soon as another thread completes using DB.
source share