From 58843c52c6dfa5722e8058565a702b4c13c32952 Mon Sep 17 00:00:00 2001 From: John Davis Date: Tue, 12 Dec 2023 15:03:29 -0500 Subject: [PATCH 1/2] Set future=True flag on the session --- lib/galaxy/model/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/model/base.py b/lib/galaxy/model/base.py index 2e4d248afeb4..5e98e0625ed2 100644 --- a/lib/galaxy/model/base.py +++ b/lib/galaxy/model/base.py @@ -63,7 +63,7 @@ def transaction(session: Union[scoped_session, Session, "SessionlessContext"]): class ModelMapping(Bunch): def __init__(self, model_modules, engine): self.engine = engine - self._SessionLocal = sessionmaker(autoflush=False, autocommit=False) + self._SessionLocal = sessionmaker(autoflush=False, autocommit=False, future=True) versioned_session(self._SessionLocal) context = scoped_session(self._SessionLocal, scopefunc=self.request_scopefunc) # For backward compatibility with "context.current" From 4fcf4746d1d9799952e07776cbf9157c094abc96 Mon Sep 17 00:00:00 2001 From: John Davis Date: Tue, 12 Dec 2023 15:03:58 -0500 Subject: [PATCH 2/2] Drop autocommit execution option: it's a noop + it won't work in SA2.0 --- lib/galaxy/model/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index d9c28d30db32..ca49b19d1211 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -5895,7 +5895,7 @@ def update_parent_folder_update_times(self): WHERE exists (SELECT 1 FROM parent_folders_of WHERE library_folder.id = parent_folders_of.folder_id) """ - ).execution_options(autocommit=True) + ) with object_session(self).bind.connect() as conn, conn.begin(): ret = conn.execute(sql, {"library_dataset_id": ldda.library_dataset_id, "ldda_id": ldda.id})