What are the steps required to enable Hibernate\'s second-level cache, when using the Java Persistence API (annotated entities)? How do I check that it\'s working? I\'m using JB
Follow-up: in the end, after adding annotations, I have it working with EhCache, i.e.
<property name="hibernate.cache.provider_class"
value="net.sf.ehcache.hibernate.EhCacheProvider" />
I believe you need to add the cache annotations to tell hibernate how to use the second-level cache (read-only, read-write, etc). This was the case in my app (using spring / traditional hibernate and ehcache, so your mileage may vary). Once the caches were indicated, I started seeing messages that they were in use from hibernate.