Should I use FullMutex or NoMutex in SQLite Flags? What is their purpose? And if yes, which should I use?
For now: I'm using these flags:
public static class SQLiteConstants
{
public const SQLiteOpenFlags Flags =
SQLiteOpenFlags.ReadWrite |
SQLiteOpenFlags.SharedCache |
SQLiteOpenFlags.Create |
SQLiteOpenFlags.FullMutex;
public static string GetDatabasePath
{
get => Path.Combine(FileSystem.AppDataDirectory, "UserScores.db3");
}
}
What NoMutex mean is that the new database connection will use the "multi-thread" threading mode. This means that separate threads are allowed to use SQLite at the same time, as long as each thread is using a different database connection.
What FullMutext mean is that new database connection will use the "serialized" threading mode. This means the multiple threads can safely attempt to use the same database connection at the same time. (Mutexes will block any actual concurrency, but in this mode there is no harm in trying.) So, you can choose the flag depend on your situation
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