Uploaded image for project: 'Hibernate ORM'
  1. Hibernate ORM
  2. HHH-11516

Level two cache may not be enabled when using @Cacheable without/instead of @Cache

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.21
    • Fix Version/s: 5.1.5, 5.2.9
    • Component/s: hibernate-core
    • Labels:
      None
    • Environment:
      * Red Hat JBoss Enterprise Application Platform (EAP) 6 / Hibernate 4
      * Red Hat JBoss Enterprise Application Platform (EAP) 7 / Hibernate 5
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      • Multiple JPA persistence units are deployed (some enable caching via hibernate.cache.use_second_level_cache=true and some do not)
      • Entities are annotated with @javax.persistence.Cacheable
      • Randomly (not reproducible at will), caching is not enabled (queries that should resolve in cache consistently go to the database)
      • DEBUG logging shows that, when the issue occurs, there are no log entries like ... [org.hibernate.cache.infinispan.InfinispanRegionFactory] Building entity cache region ...
      • The same issue has never been reproduced when @org.hibernate.annotations.Cache is used for entities and cache regions are consistently (based on DEBUG trace) seen to be created for associations (which can only be made cacheable via @Cache)

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: