#19274: Separate DB connection creation and session state initialization
-------------------------------------+-------------------------------------
     Reporter:  akaariai             |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |                  Version:  master
    Component:  Database layer       |               Resolution:  fixed
  (models, ORM)                      |             Triage Stage:  Ready for
     Severity:  Normal               |  checkin
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by Anssi Kääriäinen <akaariai@…>):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"1893467784deb6cd8a493997e8bac933cc2e4af9"]:
 {{{
 #!CommitTicketReference repository=""
 revision="1893467784deb6cd8a493997e8bac933cc2e4af9"
 Fixed #19274 -- Made db connection creation overridable in subclasses

 Connection creation was done in db backend ._cursor() call. This
 included taking a new connection if needed, initializing the session
 state for the new connection and finally creating the connection.

 To allow easier modifying of these steps in subclasses (for example to
 support connection pools) the _cursor() now calls get_new_connection()
 and init_connection_state() if there isn't an existing connection. This
 was done for all non-gis core backends. In addition the parameters used
 for taking a connection are now created by get_connection_params().

 We should also do the same for gis backends and encourage 3rd party
 backends to use the same pattern. The pattern is not enforced in code,
 and as the backends are private API this will not be required by
 documentation either.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19274#comment:4>
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to