Django transaction isolation level in mysql & postgresql

Piotr Czapla picture Piotr Czapla · Feb 17, 2010 · Viewed 7.4k times · Source

Do you know the default isolation level of the transactions used in Django? Is it possible to set the isolation level in the database independent way?

I'm mainly interested in mysql and postgres.

Answer

Peter Lundberg picture Peter Lundberg · Dec 2, 2010

You can also change this per client / session using the django database options, like this:

DATABASE_OPTIONS = { "init_command": "SET storage_engine=INNODB, SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED", }