forked from platypush/platypush
autoflush
should be passed as an option to db.get_session
.
This commit is contained in:
parent
6a2a3100f8
commit
c4f649a0d5
1 changed files with 2 additions and 2 deletions
|
@ -514,7 +514,7 @@ class DbPlugin(Plugin):
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def get_session(
|
def get_session(
|
||||||
self, engine=None, locked=False, *args, **kwargs
|
self, engine=None, locked=False, autoflush=True, *args, **kwargs
|
||||||
) -> Generator[Session, None, None]:
|
) -> Generator[Session, None, None]:
|
||||||
engine = self.get_engine(engine, *args, **kwargs)
|
engine = self.get_engine(engine, *args, **kwargs)
|
||||||
if locked:
|
if locked:
|
||||||
|
@ -527,7 +527,7 @@ class DbPlugin(Plugin):
|
||||||
session = scoped_session(
|
session = scoped_session(
|
||||||
sessionmaker(
|
sessionmaker(
|
||||||
expire_on_commit=False,
|
expire_on_commit=False,
|
||||||
autoflush=True,
|
autoflush=autoflush,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue