SQLite Forum

Sqlite3 doesn't support row level locking?
Login
If it is OK to lose cache contents on thread termination (and it is not necesary to share information between threads), then consider using one connection per thread and the special filenames ":memory:" for a private, in memory database, or "" (empty string) for a private, on disk database. You will have to create the table(s) after opening.

That way, each thread has its own database that magically disappears when the thread terminates. This is much less of a hassle than attempting to keep track of a flea bag full of disk files.