org.hibernate.cache.infinispan.query.QueryResultsRegionImpl not caching queries (marked as setCacheable(true) ), if transaction rollsback. This reproduces only for query cache, region cache works correct. This is not correctness, but performance issue. Test case: openSession beginTransaction execute any cacheable query rollback transaction close session repeat config parameters <property name="hibernate.cache.use_second_level_cache">true</property> <property name="hibernate.cache.use_query_cache">true</property> <property name="hibernate.cache.auto_evict_collection_cache">true</property> <property name="hibernate.cache.region.factory_class">org.hibernate.cache.infinispan.InfinispanRegionFactory</property> <property name="hibernate.cache.infinispan.cfg">org/hibernate/cache/infinispan/builder/infinispan-configs-local.xml</property> Possible wokaround: Instead of rollback execute session.clear than commit. But this may affect perfomance, since databases can optimize rollbacks. |