NHibernate FlushMode - Why can't NH survive everything?

I spent some time looking for how to configure NHibernate FlushMode so that it can only save objects that I called the explication Save / Update / Delete, but I realized that I couldn’t do this. Instead, I have to evict all the objects that I changed (without even calling Save / Update / Delete), since I use NHibernate transaction management.

I understand very well why NHibernate needs to clear some objects before some search operations, but I'm not worried about outdated data. I see that, perhaps, in some situation, clearing everything that has been changed, and not being saved, may be useful, but it's not my business.

I just want after my NHibernate session to insert / update / delete everything that I explicitly requested, and evict everything else. My question is: is this behavior simply a question of "no one has stopped to realize it yet" or are there other points that will fail if such behavior exists?

Thanks in advance.

Philip

+3
source share
2 answers

Nhibernate . , , (, ). , NH, , , Save ( SaveOrUpdate), . FlushMode, , , .

IStatelessSession ISession.

?

+4

: " ?"

( ) , , , ; .

, IStateLessSession ISession. . , , . , , , , ,

+2

Source: https://habr.com/ru/post/1735648/


All Articles