I have enabled second level and query caches in my app
Looks like when I invoke following code
String sql = "update SOME_TABLE set SOME_FIELD=somevalue";
SQLQuery query = getSession().createSQLQuery(sql);
query.executeUpdate();
hibernate updates UpdateTimestampsCache for ALL tables. Why he does this? I have about 1000 tables and many sql queries in my app. I dont need this updates because I dont update cached tables via sql. It causes huge netwrok traffic and slowneess of application.
Is there a way to tell hibernate to NOT do any updates when running sql queries?
I found solution!
You can use addSynchronizedEntityClass() method
In this case it will reset just cache for SOME_TABLE