In NHibernate 3.0, FlushMode.Auto
does not work when running under an ambient transaction only (that is, without starting an NHibernate transaction). Should it?
For me, I don't know the reason behind, but by forcing session flush before session is disposed seemed to worked for me. e.g. using(session) { //do your work
session.Flush(); }
I verified that this works with my distributed transaction, since without doing this, I always get "transaction has aborted" when TransactionScope is disposed.
Even set session.FlushMode to Commit did NOT work for me.