I'm using SQLite with Entity Framework Core (RC1).
I read, that SQLite supports three different threading modes: Single-thread, Multi-thread and Serialized.
How do I set in run-time, which mode I want to use with my database?
Microsoft.Data.Sqlite
references the official SQLite
NuGet package. That package contains a version of SQLite that has been compiled with SQLITE_THREADSAFE=1
(Serialized). Microsoft.Data.Sqlite
doesn't currently expose an API to change this, nor did System.Data.SQLite
.
See also aspnet/EntityFramework#5466.
It is accomplished by opening a database with the appropriate flags set. SQLITE_OPEN_NOMUTEX
for multithread or SQLITE_OPEN_FULLMUTEX
for serialized. It looks like flag setting is available through the C interface:
https://www.sqlite.org/c3ref/c_open_autoproxy.html
So if you aren't using the C interface directly, you are at the mercy of EF and whether they have decided to support flag setting on database open.