]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ignore join_transaction_mode when bind is an engine
authorFederico Caselli <cfederico87@gmail.com>
Fri, 15 Mar 2024 18:15:27 +0000 (19:15 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 25 Jun 2024 20:00:47 +0000 (20:00 +0000)
commit95054db1bff0b409fa36da9228008c4de95c970b
tree039412067576b8319378fe77418a2030a0a9e40d
parentc0bb145305a3b29afcc476cf2832e6402703350b
Ignore join_transaction_mode when bind is an engine

Ignore :paramref:`_orm.Session.join_transaction_mode` in all cases when
the bind provided to the :class:`_orm.Session` is an
class:`_engine.Engine`.
Previously if an event that executed before the session logic,
like :meth:`_engine.ConnectionEvents.engine_connect`,
left the connection with an active transaction, the
paramref:`_orm.Session.join_transaction_mode` behavior took
place, leading to a surprising behavior.

Fixes: #11163
Change-Id: I10147876d07352f2dab898d615e98a9acd6eb91b
doc/build/changelog/unreleased_20/11163.rst [new file with mode: 0644]
doc/build/changelog/unreleased_21/11163.rst [new file with mode: 0644]
lib/sqlalchemy/orm/session.py
test/orm/test_transaction.py