javacachingsecond-level-cachequery-cachehibernate-cache

How to handle Hibernate cache when I have 2 applications with different DAO implementations


I have two web applications uses the same database

  1. Management web app which responsible to modify the system configurations on the database.
  2. Business web app which responsible to serve the users request based on the configurations .

Unfortunately every application has his own DAO implementations the management web app is using hibernate only. and the business web app is using spring jpa.

now I want to implement second layer cache and query cache using clustered eh-cache how can I tell the hibernate in the management server that I have query caches in the other servers so the management server will updates the query cache if any value changed.


Solution

  • Unexpectedly the caching works without adding any extra code the hibernate is smart enough to sync the data and evicting the changed values from cache