#24810: Reopen database connection automatically when no transaction is active
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by medihack):
This issue also bit me. I have a long-running management command that
accesses the database only a few times a day, and I often get an
OperationalError that the database connection is already closed. I tried
to work around it by using ''db.close_old_connections()'', but then my
tests using pytest failed as it also closed some other connections. I
wonder if ''CONN_HEALTH_CHECKS'' makes a difference here, but I guess that
it only works with a request inside a view.
--
Ticket URL: <https://code.djangoproject.com/ticket/24810#comment:18>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018bbe2ddaa5-52ed560f-70b8-4062-bdd3-c296cac82c60-000000%40eu-central-1.amazonses.com.