Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #12452 -- Ensured that all connections are closed when a reques…

…t is finished. Thanks to for the report and fix.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9319f895478c60717a7cf2cf132ad7fa4440b4f8 1 parent 1d581cd
@freakboy3742 freakboy3742 authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/db/
7 django/db/
@@ -79,14 +79,15 @@
# Register an event that closes the database connection
# when a Django request is finished.
def close_connection(**kwargs):
- connection.close()
+ for conn in connections.all():
+ conn.close()
# Register an event that resets connection.queries
# when a Django request is started.
def reset_queries(**kwargs):
- for connection in connections.all():
- connection.queries = []
+ for conn in connections.all():
+ conn.queries = []
# Register an event that rolls back the connections
Please sign in to comment.
Something went wrong with that request. Please try again.