I have a problem with the DefaultUpdateEventListener in NHibernate. I will update 2 objects and then i commit the session.
The first object didn't come into the listener and the second object comes there.
So i checked with reflector to check what the problem is
First NHibernate will call the PerformSaveOrUpdate in the DefeultSaveOrUpdateEventListener there i see this
protected virtual object PerformSaveOrUpdate(SaveOrUpdateEvent @event)
{
switch (this.GetEntityState(@event.Entity, @event.EntityName, @event.Entry, @event.Session))
{
case EntityState.Persistent:
return this.EntityIsPersistent(@event);
case EntityState.Detached:
this.EntityIsDetached(@event);
return null;
}
return this.EntityIsTransient(@event);
}
The differens of both object is the state The first object is detached and the second persistent
What makes a object persistent or detached in NHibernate ?
If i know what the difference is in this example i hope i can fix this in my code.
The load of both object are equal with session.Load