Opened 13 years ago
Last modified 6 days ago
#19948 new Cleanup/optimization
Improve connection reset under PostgreSQL
| Reported by: | Aymeric Augustin | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
On django-developers, Christophe Pettus says:
It would be helpful to have a backend method that performers the "restore connection between uses" function, rather than just use connection.abort() (of course, the default implementation can use that). For example, on PostgreSQL, ABORT; DISCARD ALL is the recommended way of resetting a connection, so being able to implement that would be great.
This was independently suggested by Anssi, and it looks like a good idea to implement.
Change History (5)
comment:1 by , 13 years ago
| Description: | modified (diff) |
|---|
comment:5 by , 6 days ago
Hi all, sorry if im being stupid but is this ticket suggesting a new backend method that does not replace the default close behavior? In that case when would this be used? Given that this ticket is very old, can i start working on a PR with the assumption that it does imply replacement?
I think "ABORT; DISCARD ALL" may also need to be followed up with
self.init_connection_state(), because it would otherwise discard the session state that Django sets up for each connection.