#25955: FK constraints are not checked at the end of nested atomic blocks
-------------------------------------+-------------------------------------
     Reporter:  aklim007             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  DEFERRED             |             Triage Stage:
  transaction.atomic savepoint       |  Unreviewed
  postgresql                         |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by aklim007):

 * cc: aklim007@… (added)
 * status:  closed => new
 * resolution:  wontfix =>


Comment:

 Replying to [comment:2 shaib]:
 > Oh, looking at the patch, I see you expect deferred constraints to be
 checked at the end of nested `atomic` blocks.
 >
 > Unless you can point some place in the documentation where such behavior
 is described, I'd call this a huge backward incompatibility. If you can
 show such a place, please re-open.


 https://docs.djangoproject.com/en/1.9/topics/db/transactions/#controlling-
 transactions-explicitly


 {{{
 #!div style="font-size: 80%"
 Code highlighting:
   {{{#!python
 from django.db import IntegrityError, transaction

 @transaction.atomic
 def viewfunc(request):
     create_parent()

     try:
         with transaction.atomic():
             generate_relationships()
     except IntegrityError:
         handle_exception()

     add_children()
   }}}
 }}}



 In mysql it works fine.
 The current behavior of Postgres violates the logic transaktion.atomic.
 To work correctly, I have to think about nesting transaktion.atomic.
 If the function is wrapped in a atomic, atomic cause within another unit
 will conduct one another more.

 If the unit is completed successfully, I expect that everything is in
 order and there is atomic.

--
Ticket URL: <https://code.djangoproject.com/ticket/25955#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5e84eea164458965f2fa4c05803c9f43%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to