Has anyone come across the following scenario?  If so, what type of
workarounds, if any, have you attempted?  (I also logged this as an
issue in the NHibernate JIRA queue).

NHibernate appears to track entities clearly in the session as they
are worked on and accessed. As expected and desired, lazy loaded
relations won't be brought into memory or acted upon during
interactions with the session if they are never accessed, and hence
are still NOT brought into memory during a SaveUpdate/Flush. HOWEVER,
if the Flush of an entity that is already in the session causes the
realization of a lazy loaded relation, that referenced entity is
loaded by NHibernate and will have any changes to its properties
persisted. BUT, if it also as cascade relations, those are not
followed because it is too late in the tracking process and all the
cascading has already happened.

We have decided to file this as a bug as we feel that this behavior of
cascading through lazy loaded entities that are loaded in the flush,
though an edge case, is behavior that we expected. We were torn
between filing this as a either a major or minor bug, but we decided
to file this as a "major" as the only workaround we have at this point
is to fully realize the whole domain model, in which case it kind of
defeats the purpose of lazy loading.

More details, including a standalone project demoonstrating this
behavior, can be found here: https://nhibernate.jira.com/browse/NH-2919

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