#2227: transaction.commit()/rollback() should be aware of nested calls to
transaction.managed(True)
-------------------------------------+-------------------------------------
     Reporter:  mderk@…              |                    Owner:  nobody
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  transaction, nest,   |      Needs documentation:  0
  scope, nested, rollback, commit    |  Patch needs improvement:  1
    Has patch:  1                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by akaariai):

 I would like to see two new decorators, @transactional and @atomic.

 @transactional will open a new transaction if there is not already one. If
 this is the case, then it works like @commit_on_success. If there is
 already a managed transaction open, the transaction will be joined and
 @transactional is basically a no-op.

 @atomic works like @transactional if there isn't already a transaction
 open. However it differs from @transactional by creating a savepoint if
 there is already a transaction open, and of course doing a rollback-to-
 savepoint on exceptions.

 Lets be very careful with changing the existing behavior - even small
 backwards incompatible changes can lead to data corruption bugs for the
 users.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/2227#comment:32>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to