Pedro
Pedro

Reputation: 11904

About NHibernate's ISession

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()?

Upvotes: 1

Views: 133

Answers (2)

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99750

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

Upvotes: 5

Andrey
Andrey

Reputation: 60115

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

Upvotes: 5

Related Questions