]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Restore use_threadlocal equivalent behavior to SingletonThreadPool
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Apr 2019 14:03:17 +0000 (10:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Apr 2019 14:12:57 +0000 (10:12 -0400)
commita326869cf9c166afea43b1bd7d7f5dbab27abb75
tree657c26947834a98a754be1ec8c2064e36750e4c5
parentfd2ecb5f87c1c0132263b5a35067c4bb76160fb2
Restore use_threadlocal equivalent behavior to SingletonThreadPool

Fixed behavioral regression as a result of deprecating the "use_threadlocal"
flag for :class:`.Pool`, where the :class:`.SingletonThreadPool` no longer
makes use of this option which causes the "rollback on return" logic to take
place when the same :class:`.Engine` is used multiple times in the context
of a transaction to connect or implicitly execute, thereby cancelling the
transaction.   While this is not the recommended way to work with engines
and connections, it is nonetheless a confusing behavioral change as when
using :class:`.SingletonThreadPool`, the transaction should stay open
regardless of what else is done with the same engine in the same thread.
The ``use_threadlocal`` flag remains deprecated however the
:class:`.SingletonThreadPool` now implements its own version of the same
logic.

Fixes: #4585
Change-Id: I906293f2d0a5d14ed46cd9e64305a6481505a5a3
doc/build/changelog/unreleased_13/4585.rst [new file with mode: 0644]
lib/sqlalchemy/pool/impl.py
test/engine/test_pool.py