简体   繁体   English

NHibernate-当FlushMode设置为Never时,如果我通过session.Close()关闭会话,更改是否将发送到服务器?

[英]NHibernate - When FlushMode is given as Never and if I close the session by session.Close(), will the changes be sent to server?

If I have the FlushMode as Never and if I do a session.Close() will the changes be persisted to the database? 如果我将FlushMode设置为“从不”,并且如果我执行session.Close(),更改是否将保存到数据库中?

Or do we have to explicitly say session.Flush() before session.Close()? 还是我们必须在session.Close()之前明确说出session.Flush()?

Thanks 谢谢

Close() never flushes for you (whether you have FlushMode=Never or not), and even if it did, you shouldn't depend on that. Close()永远不会为您刷新(无论您是否具有FlushMode = Never),即使这样做,也不应依赖于此。

See: http://nhibernate.info/doc/nh/en/index.html#manipulatingdata-flushing 请参阅: http : //nhibernate.info/doc/nh/en/index.html#manipulatingdata-flushing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM