Reputation: 10403
Why does NHibernate require me to flush the session after I delete? It doesn't do need a flush after updating or saving.
Upvotes: 1
Views: 674
Reputation: 49301
It does need to flush after updating or saving in addition to delete. Your ISession's FlushMode setting or another factor (e.g. database generated identifiers) is causing it to flush automatically. The documentation describes the conditions that cause the session to be flushed.
In my opinion the best practice is to set the FlushMode to Commit and use transactions for all database operations, including reads (this is needed for 2nd level caching).
Upvotes: 4