Several processes accessing the Django db firewall; entries are not displayed until manually called _commit

I have a Django project in which several processes access the mysql db backend. One process creates records, while the second process tries to read these records. I have a problem where the second process that is trying to read the records cannot find the records until I manually call connection._commit ().

This question has been asked before: caching problems in MySQL answer with MySQLdb in Django

The OP stated that he solved the problem, but did not quite explain how to do this. Can someone shed some light on this? I would like to have access to records without manually calling _commit ().

Thanks,

Asif

+5
source share
2 answers

He said:

Django autocommit is not the actual autocomposition in db.

So, you have to make sure that autocommit is set to db level. Otherwise, due to transaction isolation, processes will not see the changes made by another process (another connection) before committing. AFAIK is not a particular issue for Django, except for the lack of clarity in the Django documents autocommit! = Db autocommit.

Update: Paraphrase a bit from MySQL docs:

REPEATABLE READ - InnoDB. , READ COMMITTED: . ( .)

, REPEATABLE READ , . READ COMMITTED , . - - .

+5

? , , , , , , . , .

0

All Articles