Subscribe to
Posts
Comments

Had a problem with NHibernate Lifecycle events recently where they appeared not to be firing when I was hitting ISession.Save(entity). After some investigation I finally realised that if you create a new entity, then query NHibernate it may implicitly persist the transient object during a Flush. When it does this any interceptors will be fired at *Query time* thus preventing them from firing when you explicitly call SaveNew. This is by design of NHibernate to ensure the query results are always valid, and is documented here.

Leave a Reply