代码之家  ›  专栏  ›  技术社区  ›  Kewei Shang

如何在ehcache.xml中配置querycache

  •  0
  • Kewei Shang  · 技术社区  · 16 年前

    从我的SQL日志文件中,我认为querycache的物理属性是由以下元素配置的:

      <defaultCache
                    maxElementsInMemory="0"
                    eternal="false"
                    timeToIdleSeconds="120"
                    timeToLiveSeconds="120"
                    overflowToDisk="false"
                    memoryStoreEvictionPolicy="LRU"
                    />
    

    即使我添加了另一个元素下面的元素到 EHCHACE.XML 从SQL日志中,似乎仍然由 元素。

      <cache name="org.hibernate.cache.QueryCache"
                    maxElementsInMemory="10000"
                    eternal="false"
                    timeToIdleSeconds="120"
                    timeToLiveSeconds="120"
                    overflowToDisk="false"
                    memoryStoreEvictionPolicy="LRU"
            />
    

    我只想在内存中启用querycache,同时在默认情况下禁用其他的(内存中)。也许是 名称 属性 元素不正确?我是从书中抄来的。或者,我应该使用其他元素吗?也许有某种元素?

    谢谢。

    1 回复  |  直到 16 年前
        1
  •  5
  •   OMax    16 年前

    尝试: name=“org.hibernate.cache.standardquerycache”