Hello Mark,

Indeed this is the bug described in https://code.djangoproject.com/ticket/26340 
<https://code.djangoproject.com/ticket/26340>.

It hasn’t been fixed yet because things become complicated with savepoints and 
because it isn’t obvious that it cannot introduce data corruption bugs.

Perhaps it would make sense to fix the bug at least for the whole transaction 
in rollback() and leave the ticket open for nested transactions with savepoints.

Best regards,

-- 
Aymeric.

> On 16 Nov 2016, at 15:26, Mark Young <marky1...@gmail.com> wrote:
> 
>  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
>  
> <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 <https://dpaste.de/ooTy>
> 
> Is there a django bug here or are my expectations not correct?
> 
> I have found this: https://code.djangoproject.com/ticket/26340 
> <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.
> 
> Thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com 
> <mailto:django-developers+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-developers@googlegroups.com 
> <mailto:django-developers@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-developers 
> <https://groups.google.com/group/django-developers>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/df66a920-2537-48dc-a0e2-4db2de5a54fd%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-developers/df66a920-2537-48dc-a0e2-4db2de5a54fd%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/18CBF631-B475-41C1-ADFF-27AAFFD1ABE3%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to