potiuk commented on issue #20308: URL: https://github.com/apache/airflow/issues/20308#issuecomment-1057869795
Actually It might in case Lock is kept as an object in the session. I am not sure what kind of "objects" are kept in the session. Funny thing that statement about in the documentation of SQLAlchemy is a bit ambiguous. I am not a native speaker but IMHO it's not obvious at all oif "and releases any transactional/connection resources" refers to "close()" or "expunge_all()" method. At a first glance, it should be about "close()", but if Locks are represented as objects in the session, expunge_all() might also release locks. WDYT @andrewgodwin @ashb ? https://docs.sqlalchemy.org/en/14/orm/session_basics.html#closing > The [Session.close()](https://docs.sqlalchemy.org/en/14/orm/session_api.html#sqlalchemy.orm.Session.close) method issues a [Session.expunge_all()](https://docs.sqlalchemy.org/en/14/orm/session_api.html#sqlalchemy.orm.Session.expunge_all) which removes all ORM-mapped objects from the session, and [releases](https://docs.sqlalchemy.org/en/14/glossary.html#term-releases) any transactional/connection resources from the [Engine](https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.Engine) object(s) to which it is bound. When connections are returned to the connection pool, transactional state is rolled back as well. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
