mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-09 02:09:53 -04:00
5a9882a56e
Fixed critical issue in the asyncpg driver where a rollback or commit that fails specifically for the ``MissingGreenlet`` condition or any other error that is not raised by asyncpg itself would discard the asyncpg transaction in any case, even though the transaction were still idle, leaving to a server side condition with an idle transaction that then goes back into the connection pool. The flags for "transaction closed" are now not reset for errors that are raised outside of asyncpg itself. When asyncpg itself raises an error for ``.commit()`` or ``.rollback()``, asyncpg does then discard of this transaction. Fixes: #11819 Change-Id: I12f0532788b03ea63fb47a7af21e07c37effb070 (cherry picked from commita1f220cb4d) (cherry picked from commitca69db7e1f)