Infinispan QueryCache. Put data to cache if transaction rollsback

Description

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.

Environment

hibernate 5.2.10
infinispan 8.2.5(build in)

Assignee

Unassigned

Reporter

Kuznetsov Anton

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure