ehcache « Annotation « JPA Q&A





1. Hibernate 2nd level cache    stackoverflow.com

Hi I've run into some problems with hibernate 2nd level cache. As cache provider I use ehcache. Part of config from persistence.xml

<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" />
<property name="hibernate.cache.provider_configuration_file_resource_path" value="/ehcache.xml" />
I configure my entities ...

2. config ehcache.xml for jpa entity or use annotation?    stackoverflow.com

when using ehcache rather than defining statement like

 <cache name="testonly.package.model.TestPOJOcategory"
        maxElementsInMemory="200"
        eternal="true"
      ...