Opened 15 years ago
Closed 15 years ago
#12452 closed (fixed)
Not all database connections are being closed (multidb)
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Now with multidb there can be multiple connections to different databases. Only the default one is being closed at the end of the request. I think that it should be consistent, and all databases connections should be closed. Sorry for not having a patch handy, but the fix would be (untested):
In django/db/init.py change close_connection to:
def close_connection(**kwargs): for connection in connections.all(): connection.close()
Change History (2)
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Yep, this is correct. I remembered to do it in
reset_queries()
fwiw :/