[...] you would usually need to flush the SQLAlchemy Unit of Work and commit the currently running transaction, those are operations that TurboGears2 transaction management will automatically do for us.
You don’t have to do anything to use this transaction management system, it should just work.
使用默认配置设置,在常规请求/响应周期中,TuborGears2使事务管理器能够在控制器处理完请求后自动向数据库提交更改。你知道吗
这在Wiki in 20 Minutes tutorial中介绍:
但是,对于在常规请求/响应周期之外的所有内容,例如stream,或者像scheduler这样的不同线程,都需要手动刷新会话并提交事务。这是用
DBSession.flush()
和transaction.commit()
执行的。你知道吗相关问题 更多 >
编程相关推荐