Search code examples
javaspringhibernatejpacaching

What is the cache region name in spring application?


I have 2 systems X and Y,both developed in Java spring, system X EhCacheRegionFactory is using SessionFactory, system Y uses EntityManagerFactory. The second difference is system X uses local DAOs where system Y uses JpaReposiories. If both of these systems are having the same entities, will the region factory name differ for the same entity? I know that in hibernate(System X) it will be the fully qualified class name, but for system Y I don't know the region name considering spring will be handling the cache with redission client. Both of systems will be configured to use Redis cache.


Solution

  • If you mean the names of the Hibernate L2 caches, then there will be no difference. Unless the cache implementation applies some prefixes or postfixes to the cache names Hibernate wants to create, the names will be the same.