#28836: Not nesting version of @atomic decorator
------------------------------------------+------------------------
               Reporter:  Thomas Güttler  |          Owner:  nobody
                   Type:  Uncategorized   |         Status:  new
              Component:  Uncategorized   |        Version:  1.11
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 Database transaction can't be nested.
 Database transactions are ACID. And D stand for durability.

 I think it is dangerous that the current implementation of @atomic falls
 back to savepoints, if
 already inside a transaction.

 I don't want to change the current default.

 But I would like to have a decorator which raises an exception if the
 connection is already inside a transaction.

 I don't care how the implementation looks like. I see two way:

  - a new method. For example @non_nesting_atomic
 - a kwarg: For example @atomic(non_nesting=True)   with a default of
 "False" for backward compatibility.

 What do you think?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28836>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.16acbed4db495e00fc80f503ae333d3c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to