From b4261c45ab5861e86eb26cc08510fb114db0ec12 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 25 Oct 2022 16:00:50 -0400 Subject: ensure pool.reset event always called for reset Added new parameter :paramref:`.PoolEvents.reset.reset_state` parameter to the :meth:`.PoolEvents.reset` event, with deprecation logic in place that will continue to accept event hooks using the previous set of arguments. This indicates various state information about how the reset is taking place and is used to allow custom reset schemes to take place with full context given. Within this change a fix that's also backported to 1.4 is included which re-enables the :meth:`.PoolEvents.reset` event to continue to take place under all circumstances, including when :class:`.Connection` has already "reset" the connection. The two changes together allow custom reset schemes to be implemented using the :meth:`.PoolEvents.reset` event, instead of the :meth:`.PoolEvents.checkin` event (which continues to function as it always has). Change-Id: Ie17c4f55d02beb6f570b9de6b3044baffa7d6df6 Fixes: #8717 --- lib/sqlalchemy/__init__.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/sqlalchemy/__init__.py') diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py index 5823239dc..b22d7ca8c 100644 --- a/lib/sqlalchemy/__init__.py +++ b/lib/sqlalchemy/__init__.py @@ -52,6 +52,7 @@ from .pool import ( from .pool import NullPool as NullPool from .pool import Pool as Pool from .pool import PoolProxiedConnection as PoolProxiedConnection +from .pool import PoolResetState as PoolResetState from .pool import QueuePool as QueuePool from .pool import SingletonThreadPool as SingleonThreadPool from .pool import StaticPool as StaticPool -- cgit v1.2.1