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 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 > in question is a django model ValidationError, so no rollback should be > needed, since the save never actually hits the db. At the minimum, however, > I would expect a transaction.rollback() to resolve the issue, but it does > not. > > The traceback: https://dpaste.de/ooTy > > Is there a django bug here or are my expectations not correct? > > Thanks > -- 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...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/879a8b4a-09ad-4326-bf64-f58930205b3c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.