How do you implement @commit_manuallyin Django 1.8?
I am trying to update Django 1.5 code to work with Django 1.8, and for some bizarre reason, the decoder commit_manuallywas removed in Django 1.6 without a direct replacement. My process iterates through thousands of records, so it cannot completely wrap the whole process in a single transaction without running out of memory, but to improve performance, it is still necessary to group some records in a transaction. For this, I had a method wrapped with @commit_manually that called transaction.commit () every N iterations.
I cannot say for sure from the docs , but this is still supported. I just need to call set_autocommit(False)instead of a convenient decorator. Is it correct?
Cerin source
share