Skip to content Skip to sidebar Skip to footer

Does Django Create Implicit Transaction On First Query?

I have django 1.3.1, python2.6 and MySQL 5.5.20. init_command in setting.py is set to SET storage_engine=INNODB. I have the following situation: Consider the model: class Fruit(mod

Solution 1:

This is a issolation issue. You can relax to 'isolation level read commited' to avoid this behavior. Also, learn about this issolation level implications (phantoms).

To set Read Commited Isolation Level into MySQL for your django project you should set this parameter in settings.py:

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

Post a Comment for "Does Django Create Implicit Transaction On First Query?"