Turned out that it was the issue of default transaction isolation levels used by InnoDB tables in MySQL. After googling, came across the foll. link:
Django application does not see db changes made by external sources - Django users | Google Groups
The default level for InnoDB is *repeatable read*. In this isolation mode, each transaction gets to work in an isolated version of the table where each row remains as it was when the transaction started. Reading a row is guaranteed to be repeatable.
If you want script1.py (using an InnoDB table) to see committed updates from other transactions you can change the transaction isolation level like so:
from django.db import connection
connection.cursor().execute('set transaction isolation level read committed')
1 comment:
Really! It pays the worth of reading, I appreciate your work!
Read on: Terror Strikes
Post a Comment