The only thing done by IsDirty is just fire an event
DirtyCheckEvent dcEvent = new DirtyCheckEvent(this);
IDirtyCheckEventListener[] dirtyCheckEventListener =
listeners.DirtyCheckEventListeners;
for (int i = 0; i < dirtyCheckEventListener.Length; i++)
{
dirtyCheckEventListener[i].OnDirtyCheck(dcEvent);
}
return dcEvent.Dirty;
You can disable/replace/override that event.On Tue, May 24, 2011 at 10:21 AM, Ricardo Peres <[email protected]> wrote: > Fabio, > You have closed JIRA issues NH-2727 saying that it is not an issue. > Perhaps you can explain me, because this is bugging me, why does the > following line raise the SaveOrUpdate event and the next doesn't: > > //raises SaveOrUpdate > User u = session.Query<User>().FirstOrDefault(); > UserGroup ug = u.UserGroup.First(); > > //does not raise > UserGroup ug = session.Query<UserGroup>().FirstOrDefault(); > User u = ug.User; > > By the way, in general, why does ISession.IsDirty() fire any events? > Shouldn't it just check the current state of entities in memory? > > Thank you for your time, once again! > > RP -- Fabio Maulo
