Hi!

I've got a web service (via WCF) that returns entities retrieved via NHibernate to the client. To simplify integration, I've added some scaffolding code that automatically starts a session when WCF receives a request and closes it when the request returns.

This has the (desired) side effect of bombing out early if my web service returns an entity that would lazy-load additional properties upon serialization (desired because this would present a performance issue, cause more data to be transmitted than I was expecting and in case of circular references lead to a stack overflow or oom situation).

Is there a way to disconnect an entity from the NHibernate ISession so that accessing a normally lazy-loaded reference property simply returns null? I tried ISession.Evict(), but it still throws an exception if I access a lazy-loaded property of my entity after closing the session.

-Markus-

--
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