From c4f649a0d5eabe2ada5f4821a86aa1026622eb30 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 10 Dec 2022 16:20:14 +0100 Subject: [PATCH] `autoflush` should be passed as an option to `db.get_session`. --- platypush/plugins/db/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/db/__init__.py b/platypush/plugins/db/__init__.py index 0f97d220e..e777ca169 100644 --- a/platypush/plugins/db/__init__.py +++ b/platypush/plugins/db/__init__.py @@ -514,7 +514,7 @@ class DbPlugin(Plugin): @contextmanager def get_session( - self, engine=None, locked=False, *args, **kwargs + self, engine=None, locked=False, autoflush=True, *args, **kwargs ) -> Generator[Session, None, None]: engine = self.get_engine(engine, *args, **kwargs) if locked: @@ -527,7 +527,7 @@ class DbPlugin(Plugin): session = scoped_session( sessionmaker( expire_on_commit=False, - autoflush=True, + autoflush=autoflush, ) )