[英]Configure Query Cache in Hibernate4
我正在尝试在我们的应用程序中启用查询缓存。 根据我给出的文件
hibernate.cache.use_query_cache
为true
并在我的查询中给出了setCacheable()
。 但我得到的是异常。
org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath).
我应该为查询缓存指定缓存区域,我正在使用Hibernate 4.请在这方面帮助我
使用以下进行休眠4。
我在hibernate 4.3中使用它
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.