NetSide
NetSide

Reputation: 3890

What is the business of Session.Clear() in NHibernate?

What does Session.Clear() do in NHibernate? I mean, what is the meaning of Clear in session?

Upvotes: 9

Views: 8748

Answers (1)

Torkel
Torkel

Reputation: 3404

  • It will clear the unit of work (if you have unflushed changes, they will be discarded)
  • It will remove all current entities in the session from the identity map, in effect it will be as if you called session.Evict on all instances loaded through this session.

Not sure what else.

Upvotes: 11

Related Questions