We use one (read-only) session which we disconnect as soon as we
retrieve the data from the database. The data retrieved, often has
lazy-loaded properties which are not initialized yet.

When we try to access the properties, the following exception gets
thrown:

NHibernate.LazyInitializationException

Initializing[NHibernateTest.AppUser#16]-failed to lazily initialize a
collection of role: NHibernateTest.AppUser.Permissions, session is
disconnected

Is there a way (add-on/interceptor) to automatically detect that the
application is trying to access an uninitialized property, so that the
interceptor can quickly open the connection and close it after the
unit of work?

Fetching everything at once would nullify the usage of laziness.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to