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}) 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"