commit 982986507371e78d9c9f5e1d0112efd645c09df9
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sat Feb 5 04:58:20 2022 +0000
Refactor session "is_active" handling for sqlalchemy-20
Since sqlalchemy 1.4, "session.autocommit" is False by default; in
sqlalchemy 2.0 this will be the only value accepted.
The ``_orm.Session`` is considered active when [1]:
- there is a transaction and this transaction is active
- there is no transaction [2], the class ``_orm.Session`` will
autobegin when it is first used.
The second one breaks the way Neutron considers a session is active:
only when a transaction is in place, Neutron considers a session is
active.
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/828739 /opendev. org/openstack/ neutron/ commit/ 982986507371e78 d9c9f5e1d0112ef d645c09df9
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 982986507371e78 d9c9f5e1d0112ef d645c09df9
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sat Feb 5 04:58:20 2022 +0000
Refactor session "is_active" handling for sqlalchemy-20
Since sqlalchemy 1.4, "session. autocommit" is False by default; in
sqlalchemy 2.0 this will be the only value accepted.
The ``_orm.Session`` is considered active when [1]:
- there is a transaction and this transaction is active
- there is no transaction [2], the class ``_orm.Session`` will
autobegin when it is first used.
The second one breaks the way Neutron considers a session is active:
only when a transaction is in place, Neutron considers a session is
active.
[1]https:/ /github. com/sqlalchemy/ sqlalchemy/ blob/rel_ 1_4/lib/ sqlalchemy/ orm/session. py#L3918- L3950 /github. com/sqlalchemy/ sqlalchemy/ blob/rel_ 1_4/lib/ sqlalchemy/ orm/session. py#L3930- L3932
[2]https:/
Partial-Bug: #1962153
Topic: sqlalchemy-20
Change-Id: Iabaee4e556afb3 dc75a82d99dc4a5 97fe4d7dd21