| Hi @Selaron, So, I have the same versions of Hibernate and EHCache. Things that probably matter are making sure jcache.xml is on the path. I have the file in src/main/resources and
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
And then in persistence.xml I have
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jcache.JCacheRegionFactory"/>
<property name="hibernate.javax.cache.provider" value="org.ehcache.jsr107.EhcacheCachingProvider"/>
<property name="hibernate.javax.cache.uri" value="classpath:jcache.xml"/>
I'm not sure about the creation of a cache for each object. In my testing I couldn't see any SQL queries hitting the database, and the cache statistics were returning mostly hits for the cache. I don't think there were explicit caches in EHCache 2.0 either. |