#31233: Improve handling of database connection and cursor resources
-------------------------------------+-------------------------------------
               Reporter:  Jon        |          Owner:  nobody
  Dufresne                           |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Database   |        Version:  master
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Some areas of the code do not always close a database connection or cursor
 object after use. Instead it waits for the Python garbage collector to
 remove it.

 Like file resources, database resource ownership and lifetime should be
 deliberate and deterministic.

 A common example is the `_nodb_connection` property which opens a
 connection but is rarely closed.

 
https://github.com/django/django/blob/335c9c94acf263901fb023404408880245b0c4b4/django/db/backends/base/base.py#L609-L618

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31233>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.4cdad2aaceaeff886cf3869aa0c10345%40djangoproject.com.

Reply via email to