I’ve recently upgraded to Django 5.1 and configured the database pooling option with the following settings:
DATABASES["default"]["OPTIONS"] = {
"pool": {"min_size": 2, "max_size": 4, "timeout": 10}
}
DATABASES["default"]["CONN_MAX_AGE"] = None
However, I encountered the following error: ImproperlyConfigured: Pooling doesn't support persistent connections.
I understand that removing CONN_MAX_AGE = None
will resolve this issue, but I would like to gain a deeper understanding of this limitation. Specifically, is the restriction on using persistent connections with pooling a constraint unique to Django’s implementation, or does it extend to PostgreSQL
(or other databases) in general? Additionally, what are the underlying reasons for this incompatibility?