【发布时间】:2019-09-12 02:06:56
【问题描述】:
在单个会话中,如果我想:
// make a query on Foo table to get one instance
// update this instance
// commit() or not?
// make the same query on Foo table
我会在这两个查询中得到相同的结果吗?也就是说,是否需要在单个会话中对表进行查询之前提交更新?
谢谢!
【问题讨论】:
-
在默认配置下,sqlalchemy 将在发出第二个查询之前自动发出挂起更改的刷新:docs.sqlalchemy.org/en/13/orm/…。
标签: database sqlalchemy transactions