Does batch update command exist in NHibernate? As far as I am aware it doesn\'t. So what\'s the best way to handle this situation? I would like to do the following:
You don't need to update, nor flush:
IList users = session.CreateQuery (...).List;
users.Foreach(u=>u.Country="Antartica")
session.Transaction.Commit();
I think NHibernate writes a batch for all the changes.
The problem is, that your users need to be loaded into memory. If it gets a problem, you can still use native SQL using NHibernate. But until you didn't prove that it is a performance problem, stick with the nice solution.