开发者

About NHibernate's ISession

开发者 https://www.devze.com 2023-01-18 09:47 出处:网络
In this question, the user asks the better way to close sessions because he was having some errors. The most voted answer is Ayende\'s answer that says:

In this question, the user asks the better way to close sessions because he was having some errors.

The most voted answer is Ayende's answer that says:

You should always use session.Dispose(); The other are for开发者_高级运维 very strange occurances

Should I really always call session.Dispose()? Isn't enough to call session.Close()?


Session Dispose() does a couple more things than just Close()ing, so yes, always use Dispose()


Rule of thumb in .net is "if class is IDisposable always call Dispose", but better use using

0

精彩评论

暂无评论...
验证码 换一张
取 消