我已经配置了默认缓存(用于元素)、标准查询缓存(用于查询)和更新时间戳缓存(我认为是用于跟踪数据库更新...但我不是很确定它实际上是做什么的)EHCache。
我已经为这些缓存中的每一个设置了maxElementsInMemory,但我不知道这个数字对StandardQueryCache和UpdateTimestampsCache控制什么。我知道在默认缓存中可以缓存的实体数量不能超过10000,但查询缓存不会缓存元素,它缓存主键(就我所理解的而言)。
那么这是否意味着StandardQueryCache的maxElementsInMemory控制结果的“行”数,还是控制其可能具有的元素的主键对的数量?
UpdateTimestampsCache又如何呢?它跟踪实体上次更新的时间、表上次更新的时间还是其他什么?我应该为此使用什么maxElementsInMemory数字?
谢谢!
我已经为这些缓存中的每一个设置了maxElementsInMemory,但我不知道这个数字对StandardQueryCache和UpdateTimestampsCache控制什么。我知道在默认缓存中可以缓存的实体数量不能超过10000,但查询缓存不会缓存元素,它缓存主键(就我所理解的而言)。
那么这是否意味着StandardQueryCache的maxElementsInMemory控制结果的“行”数,还是控制其可能具有的元素的主键对的数量?
UpdateTimestampsCache又如何呢?它跟踪实体上次更新的时间、表上次更新的时间还是其他什么?我应该为此使用什么maxElementsInMemory数字?
谢谢!
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect" dynamicConfig="true">
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="3600">
</defaultCache>
<cache
name="org.hibernate.cache.internal.StandardQueryCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="3600">
</cache>
<cache
name="org.hibernate.cache.spi.UpdateTimestampsCache"
maxElementsInMemory="10000"
eternal="true">
</cache>
</ehcache>