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()