Repeating queries for associations marked with @Cache and @Filter in Hibernate
Issue
-
A collection association is marked cacheable and also has a filter
@OneToMany(...) @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @Filter(...) private List<Employee> employees;
-
Attempts to access the association within each new session seem to bypass the cache and trigger a database query
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) (all versions)
- Hibernate (all versions)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.