I'm asking about the .Net implementation - System.Data.SQLite. Are there guidelines to using it in a thread-safe manner?
I know SQLite itself can be compiled with or without thread safety - but how was System.Data.SQLite compiled?
It is not thread-safe, so you cannot share connection objects or similar across threads.
The thread bugfixes mentioned in the readme file has to do with multiple threads using multiple connections (ie. one each) to the same file, and what kind of problems or race conditions that might produce.
For instance, the thread race condition mentioned for BEGIN and BEGIN IMMEDIATE had the unfortunate effect that even though a thread issued a BEGIN, another thread that issued a BEGIN afterwards could still end up owning the database before the first one did. These types of situations have been fixed.
But database connections (oracle, sqlite, ms sql server) in .NET are not thread-safe, nor are the surrounding objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With