One SQLiteConnection per thread? One SQLiteConnection per thread? sqlite sqlite

One SQLiteConnection per thread?


Yes. In fact, it's the proper way, as SQLite is not thread safe (by default. You can make it threadsafe compiling with some option). And just to ensure it works: SQLite is being used in some small websites, so multithreading is there :)

Here more information: http://www.sqlite.org/faq.html#q6


Given you use a separate connection per thread you should be fine.

From docs

Note that SQLiteConnection instance is not guaranteed to be thread safe. You should avoid using the same SQLiteConnection in several threads at the same time. It is recommended to open a new connection per thread and to close it when the work is done.