From af1db229b93e8ae408682f84fa72d38c6e827bec Mon Sep 17 00:00:00 2001 From: "wu.chunyang" Date: Wed, 14 Sep 2022 16:29:07 +0800 Subject: Fix compatibility with oslo.db 12.1.0 oslo.db 12.1.0 has changed the default value for the 'autocommit' parameter of 'LegacyEngineFacade' from 'True' to 'False'. This is a necessary step to ensure compatibility with SQLAlchemy 2.0. However, we are currently relying on the autocommit behavior and need changes to explicitly manage sessions. Until that happens, we need to override the default. Change-Id: I93ab8e0cce22a71efc08f73bde804d99a63b4a8d --- trove/db/sqlalchemy/session.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trove/db/sqlalchemy/session.py b/trove/db/sqlalchemy/session.py index 39a0f218..1d2a1e08 100644 --- a/trove/db/sqlalchemy/session.py +++ b/trove/db/sqlalchemy/session.py @@ -94,6 +94,10 @@ def _create_facade(options): # use enginefacade.from_config() instead database_opts = dict(CONF.database) database_opts.pop('query_log') + # FIXME(wuchunyang): we need to remove reliance on autocommit + # semantics ASAP. since it's not compatible with + # SQLAlchemy 2.0 + database_opts['autocommit'] = True _FACADE = session.EngineFacade( options['database']['connection'], **database_opts -- cgit v1.2.1