From ab4bb5b2f93d5bb4e1375594adad9d8c596fb8a7 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Thu, 13 Mar 2025 10:23:00 +0100 Subject: [5.1.x] Fixed #33497 -- Doc'd that persistent DB connections should be disabled in ASGI and async modes. Backport of 8713e4ae96817a0c7be3f7a8fee25a7c7f819721 from main. --- docs/topics/async.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/topics/async.txt') diff --git a/docs/topics/async.txt b/docs/topics/async.txt index 87550ff46d..204d79fc8c 100644 --- a/docs/topics/async.txt +++ b/docs/topics/async.txt @@ -148,6 +148,11 @@ Transactions do not yet work in async mode. If you have a piece of code that needs transactions behavior, we recommend you write that piece as a single synchronous function and call it using :func:`sync_to_async`. +:ref:`Persistent database connections `, set +via the :setting:`CONN_MAX_AGE` setting, should also be disabled in async mode. +Instead, use your database backend's built-in connection pooling if available, +or investigate a third-party connection pooling option if required. + .. _async_performance: Performance -- cgit v1.3