From 42eb5085150bfd3068834f0a3b7f1ea2ff377bc4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 6 Aug 2022 20:05:35 +0200 Subject: [PATCH] Attempt fix of #7184 --- freqtrade/persistence/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index f0fa05343..7f851322e 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -53,7 +53,7 @@ def init_db(db_url: str) -> None: # https://docs.sqlalchemy.org/en/13/orm/contextual.html#thread-local-scope # Scoped sessions proxy requests to the appropriate thread-local session. # We should use the scoped_session object - not a seperately initialized version - Trade._session = scoped_session(sessionmaker(bind=engine, autoflush=True)) + Trade._session = scoped_session(sessionmaker(bind=engine, autoflush=False)) Trade.query = Trade._session.query_property() Order.query = Trade._session.query_property() PairLock.query = Trade._session.query_property()