Django transaction isolation level in mysql & postgresql

后端 未结 5 946
野趣味
野趣味 2020-12-19 16:44

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 in

5条回答
  •  星月不相逢
    2020-12-19 17:07

    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", }
    

提交回复
热议问题