0

I can use HQL to do bulk operations but these operations do not update the first level cache of NHibernate, so I'm facing various problems because I do not want to clear the session or refresh objects.

Is there any way of performing bulk updates / deletes without using HQL or native SQL with affecting the in-memory state of NHibernate cache?

  • NO. As I've already showen you in [this answer to your previous quesiton](http://stackoverflow.com/a/26794467/1679310), DML is not effecting in memory state - the session. – Radim Köhler Nov 07 '14 at 15:58
  • 1
    Yeah. Realize that this isa n obvious limitation of using an ORM to start with. If you think an hour about the possible problems you would get you will liekly realize WHY it is like this. – TomTom Nov 09 '14 at 11:21

1 Answers1

1

So, it seems that the only way is to handle it manually and refresh the object:

session.Refresh(entity);