使用什么样的缓存,以及使用什么缓存策略是在配置文件中配置的:

补遗:CacheFactory<?xml version="1.0"?>
补遗:CacheFactory
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
补遗:CacheFactory
补遗:CacheFactory
<hibernate-mapping>
补遗:CacheFactory    
<class name="com.fankai.Cat" table="cat">
补遗:CacheFactory        
<jcs-cache usage="read-only"/>
补遗:CacheFactory        
<id name="id" unsaved-value="null">
补遗:CacheFactory            
<generator class="uuid.hex"/>
补遗:CacheFactory        
</id>
补遗:CacheFactory        
<property name="name" length="16" not-null="true"/>
补遗:CacheFactory        
<property name="sex" length="1" not-null="true"/>
补遗:CacheFactory        
<property name="weight" />
补遗:CacheFactory    
</class>
补遗:CacheFactory
</hibernate-mapping>



上面指出,对cat表使用read-only策略的JCS缓存。

在CacheFactory中,根据从配置文件中读出的element创建缓存:

补遗:CacheFactorypublic static CacheConcurrencyStrategy createCache(Element node, String name, boolean mutable)


不过,在CacheFactory只是指定了使用什么策略,而具体使用什么缓存机制则是在client指定的。

相关文章:

  • 2021-06-02
  • 2021-05-24
  • 2021-08-10
  • 2022-01-16
  • 2022-12-23
  • 2021-12-31
  • 2022-02-25
  • 2021-07-19
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2021-08-21
  • 2021-11-04
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案