Hibernate 2nd level cache invalidation when another process modifies the database

前端 未结 6 1139
[愿得一人]
[愿得一人] 2020-12-07 19:16

We have an application that uses Hibernate\'s 2nd level caching to avoid database hits.

I was wondering if there is some easy way to invalidate the Java application

6条回答
  •  清歌不尽
    2020-12-07 19:54

    One thing to take into account when using distributed cache is that QueryCache is local, and evicting it on one node, does not evicts it from other. Another issue is - evicting Entity region without evicting Query region will cause N+1 selects,when trying to retrieve date from Query cache. Good readings on this topic here.

提交回复
热议问题