简体   繁体   English

无法正确使用ehCache

[英]Not able to use ehCache properly

I am new to ehcache. 我是ehcache的新手。 I am not able to use ehcahe.. everytime i query through hibernate template, it hit the db only.. no caching :( what am i missing? 我无法使用ehcahe ..每次我通过休眠模板查询时,它仅命中数据库。.没有缓存:(我缺少什么?

my ehcache_xml:: 我的ehcache_xml ::

<?xml version="1.0" encoding="UTF-8"?>

    <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
    <diskStore path="java.io.tmpdir" />
    <defaultCache maxElementsInMemory="500" eternal="true"
        timeToIdleSeconds="10000" timeToLiveSeconds="60000" overflowToDisk="false" />

    <cache name="com.abc.hibernate.model.ViewOrderSummary"
        maxEntriesLocalHeap="10000" eternal="false" overflowToDisk="true"
        timeToIdleSeconds="300" timeToLiveSeconds="600" diskPersistent="true" />
</ehcache>

and which below property to use? 以及下面哪个属性可以使用?

    <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop> 
                    <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>

尝试这个

<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM