Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
By "commit_manually" I meant set_autocommit(False). Sorry for the confusion. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroup

Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
In the real code, we have much more complex code flow where transaction.atomic offers no readability improvement (imo) over commit_manually. (and even if transaction.atomic were an improvement at all call sites, we have lots of code using commit manually which cannot be changed immediately.) -

Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread Simon Charette
Hello Mark, Is there a reason for not using the transaction.atomic context manager instead of managing your transaction manually by calling .set_autocommit(False) and rollback? Simon Le lundi 14 novembre 2016 15:46:38 UTC-5, mark...@gmail.com a écrit : > > After a validationError occurs, why i

Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
I have found this: https://code.djangoproject.com/ticket/26340 , where Aymeric Augustin said that he thought that transaction.rollback should indeed set DatabaseWrapper.needs_rollback to False, as I would expect. -- You received this message because you are subscribed to the Google Groups "Dja

DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
After a validationError occurs, why is the transaction considered dirty, blocking all db reads/writes? In this example: https://bitbucket.org/marky1991/django-test/raw/59c9ff89e4b12b4a831c36171139cb022735201b/test1.py , I don't really expect a TransactionManagementError at all, as the failure