Skip to content

Commit 2439a9c

Browse files
committed
Sessionmaker flush false
1 parent fdaef19 commit 2439a9c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

brood/db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def create_brood_engine(url: Optional[str], pool_size: int, statement_timeout: i
2929
pool_size=BROOD_POOL_SIZE,
3030
statement_timeout=BROOD_DB_STATEMENT_TIMEOUT_MILLIS,
3131
)
32-
SessionLocal = sessionmaker(bind=engine)
32+
SessionLocal = sessionmaker(autoflush=False, bind=engine)
3333

3434

3535
def yield_db_session_from_env() -> Session:
@@ -53,7 +53,7 @@ def yield_db_session_from_env() -> Session:
5353
pool_size=BROOD_POOL_SIZE,
5454
statement_timeout=BROOD_DB_STATEMENT_TIMEOUT_MILLIS,
5555
)
56-
RO_SessionLocal = sessionmaker(bind=RO_engine)
56+
RO_SessionLocal = sessionmaker(autoflush=False, bind=RO_engine)
5757

5858

5959
def yield_db_read_only_session() -> Session:

0 commit comments

Comments
 (0)