#14165: Transaction management is only entered for the primary database
---------------------------------------------------+------------------------
          Reporter:  sa...@mahalo.com              |         Owner:  nobody     
                      
            Status:  new                           |     Milestone:             
                      
         Component:  Database layer (models, ORM)  |       Version:  1.2        
                      
        Resolution:                                |      Keywords:  
transactions, middleware, multidb
             Stage:  Design decision needed        |     Has_patch:  0          
                      
        Needs_docs:  0                             |   Needs_tests:  0          
                      
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Design decision needed
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 There is a design decision needed here. The TransactionMiddleware clearly
 wasn't designed with multiple databases in mind.

 I don't think the fix is as simple as just making all non-default
 databases non-managed; that implies a bunch of assumptions about non-
 default databases that I'm not convinced hold in the general case (or even
 in the common case).

 Documenting the single-database nature of the TransactionMiddleware would
 be the easist solution; if you have more than one database, you may need
 to write your own TransactionMiddleware that will operate in the way you
 want it to behave.

 Alternatively, it might be possible to define a configuration mechanism
 for TransactionMiddleware, defining which databases need to be put into
 management, etc. My concern here is what happens on the error case -- how
 do we describe, in a general fashion, what happens if DB2 is rolled back
 -- do we then roll back DB1? What happens if DB1 has already been
 committed?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14165#comment:1>
Django <http://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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to