commit ef1e8abb89141db39e62eaa1cbdb73aca1ceb647
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sun Feb 6 09:54:23 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- lib/+/828738 /opendev. org/openstack/ neutron- lib/commit/ ef1e8abb89141db 39e62eaa1cbdb73 aca1ceb647
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit ef1e8abb89141db 39e62eaa1cbdb73 aca1ceb647
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sun Feb 6 09:54:23 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.
Depends-On: https:/ /review. opendev. org/c/openstack /neutron/ +/833247
[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:/
Closes-Bug: #1962153
Topic: sqlalchemy-20
Change-Id: Iabaee4e556afb3 dc75a82d99dc4a5 97fe4d7dd21