Event system

We have learned that entity state in the memory is synchronized to the database either when session is flushed or transaction is committed. All the calls we made to ISession.Save or ISession.Update till that point do not send any changes to the database. Instead, what they do is create an event and push it into the events array maintained by the session. When the session is flushed (explicitly or via committing the transaction), then NHibernate goes through each of the events and executes them one by one. As usual, I am making it easy by giving you a 10,000 feet view of how events work. Exact working of the events is more complex in reality. Intent of this section is not to understand how the events work internally. This section is ...

Get Learning NHibernate 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.