I\'m using Spring Boot 1.2.5 with JPA2 to annotate entities (and hibernate as underlaying JPA implementation).
I wanted to use second level cache in that setup, so e
@Daimon I am not really sure, whether
spring.jpa.properties.javax.persistence.sharedCache.mode=ALL
is the best decision.
Quoted from Hibernate 20.2.1. Cache mappings documentation section
By default, entities are not part of the second level cache and we recommend you to stick to this setting. However, you can override this by setting the shared-cache-mode element in your persistence.xml file or by using the javax.persistence.sharedCache.mode property in your configuration.
whereas
ENABLE_SELECTIVE (Default and recommended value): entities are not cached unless explicitly marked as cacheable.
So, could it be, that you have not annotated all affected entities with @javax.persistence.Cacheable or rather @org.hibernate.annotations.Cache ? This could lead to the affect, that the Query Cache tried to look up the affected entities in the Second Level Cache without success and then started to fetch each entity by a single select.