NHibernate’s Session and EF’s ObjectContext are implementations of Unit of Work pattern and suggest similar approaches for change tracking: you retrieve some entities, then modify them somehow and after that call SaveChanges/SubmitChanges/Save/etc.
I don’t like the implicitness of this approach. I don’t like that entity modification automatically means it will be saved. I would like to explicitly mark entities that should be saved. What are the best ways to achieve this kind of control in NHibernate or EF?
(note: fortunately I’ve never dealt with EF; my answer is about NH only)
I think your initial assumption is wrong:
that’s not true; in order to persist the changes you’ve made you need to either:
unless you do any of the above your changes would not be persisted.
Personally I feel that NH gives me complete control over what goes into my DB.
here’s a good article.