My user object is almost always retrieved by username, and not by its whole surrogate key. Since the username is not a primary key, this means that ISession will not cache it and repeatedly enters the database to obtain the same data.
Is there any way to configure NHibernate to force ISession to cache users retrieved by username?
David source
share