#2227: [patch] transaction.commit()/rollback() should be aware of nested calls 
to
transaction.managed(True)
------------------------------+---------------------------------------------
 Reporter:  [EMAIL PROTECTED]   |        Owner:  adrian
     Type:  defect            |       Status:  new   
 Priority:  normal            |    Milestone:        
Component:  Database wrapper  |      Version:  SVN   
 Severity:  major             |   Resolution:        
 Keywords:                    |  
------------------------------+---------------------------------------------
Comment (by [EMAIL PROTECTED]):

 ''But what's about commit_unless_nested() or rollback_unless_nested()?''
 
 The problem here is that You can call a @commit_manually-decorated
 function, that insist on doing commit/rollback in the function body (it
 will raise an exception if you don't), or any function that omits the
 transaction decorator syntax, but calls a commit/rollback explicitly (e.g.
 when only custom SQL is used in the function). So, it means that you can
 not safely call any code with emplicit or explicit commit/rollback in it
 within another transaction block. Another reason is BC - you should
 replace all the manual commits/rollbacks to commit_unless_nested() or
 rollback_unless_nested() all over the place, and to decide where it is
 appropriate or not.
 And I don't think that You '''really''' do want a commit or a rollback to
 happen if You are in the nested transaction block - It would definitely
 break integrity of the application. The maximum the transaction.commit()
 shoild do in this case is to make a savepoint if available. But if the
 surrounding block wants to rollback, it should be able to do so (it won't
 be able if its transaction was already commited in the nested block).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2227>
Django <http://code.djangoproject.org/>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to