zopefoundation / zope.sqlalchemy

Integration of SQLAlchemy with transaction management
Other
32 stars 34 forks source link

session.transaction is deprecated in sqlalchemy 2.0 #59

Closed tdamsma closed 3 years ago

tdamsma commented 3 years ago

session.transaction is deprecated in sqlalchemy 2.0, se here: https://docs.sqlalchemy.org/en/14/orm/session_api.html?highlight=get_transaction#sqlalchemy.orm.Session.get_transaction

So use session.get_transaction() instead. Unfortunately this in only available from sqlalchemy 1.4.

icemac commented 3 years ago

@tdamsma Thank you for your contribution. We still need to support older SQLAlchemy versions here, so it seems we have the need for a version check to use the new API. Would you like to implement such a check and fix the tests (currently the linter fails)?