Description of problem: 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) Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: * 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 Actual results: Expected results: Additional info:
Test: http://git.app.eng.bos.redhat.com/git/hibernate/hibernate-core.git/commit/?h=4.2&id=d60c664695a5cfe7f6daa92a8d16f4faefa6ca3d http://git.app.eng.bos.redhat.com/git/hibernate/hibernate-core.git/commit/?h=4.2&id=f6ce2fde99499f72ba24d996da97f27288ef9ebb Fix: http://git.app.eng.bos.redhat.com/git/hibernate/hibernate-core.git/commit/?h=4.2&id=79e4de928d74e984c97c5a3a5ba4c2537b038542
Verified with EAP 6.4.15.CP.CR2
Released on May 18 as part of EAP 6.4.15.