]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add new "exec_once_unless_exception" system; apply to dialect.initialize
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 16 Aug 2019 22:07:06 +0000 (18:07 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Aug 2019 14:43:37 +0000 (10:43 -0400)
commitd1d15c9d6060d5ea7529256e830d5134a9a8f91a
tree1bd027927e4f4f6f750a24bfdb0c2e08a1da19f5
parentf46cb615d4522936ccc42a47b2bc1e71a9432968
Add new "exec_once_unless_exception" system; apply to dialect.initialize

Fixed an issue whereby if the dialect "initialize" process which occurs on
first connect would encounter an unexpected exception, the initialize
process would fail to complete and then no longer attempt on subsequent
connection attempts, leaving the dialect in an un-initialized, or partially
initialized state, within the scope of parameters that need to be
established based on inspection of a live connection.   The "invoke once"
logic in the event system has been reworked to accommodate for this
occurrence using new, private API features that establish an "exec once"
hook that will continue to allow the initializer to fire off on subsequent
connections, until it completes without raising an exception. This does not
impact the behavior of the existing ``once=True`` flag within the event
system.

Fixes: #4807
Change-Id: Iec32999b61b6af4b38b6719e0c2651454619078c
(cherry picked from commit 2051fa2ce9e724e6e77e19067d27d2660e7cd74a)
doc/build/changelog/unreleased_13/4807.rst [new file with mode: 0644]
lib/sqlalchemy/engine/strategies.py
lib/sqlalchemy/event/attr.py
lib/sqlalchemy/event/registry.py
lib/sqlalchemy/pool/base.py
lib/sqlalchemy/util/langhelpers.py
test/base/test_events.py
test/engine/test_reconnect.py