Enabling Hibernate second-level cache with JPA on JBoss 4.2

后端 未结 2 1153
别那么骄傲
别那么骄傲 2021-02-09 00:51

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

2条回答
  •  清歌不尽
    2021-02-09 01:31

    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.

提交回复
热议问题