I know (or at least, I think that I know), that in standard there are four isolation levels when dealing with transactions:
READ UNCOMMITTED - will allow everything
READ COMMITTED - will not allow dirty reads
REPEATABLE READ - will not allow dirty, non-repearable reads
SERIALIZABLE - will not allow dirty, non-repearable, phantom reads
I know that and, for example, when dealing with MySQL
I can do something like:
cursor = db.cursor()
cursor.execute("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED")
Or, if I'm dealing with Postgre, I can do something like:
db.set_isolation_level(3) # corresponds to SERIALIZABLE
So, I wonder, if I can do something similar to that when dealing with SQLite
. I've only seen:
db.isolation_level = None
but I'm not sure what it means and how I can set other isolation levels (if they exist in the context of SQLite
). Thanks!
There are PRAGMA statements in sqlite. It seems you can do this:
db.execute("PRAGMA read_uncommitted = true;");
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