Home > Database > Mysql Tutorial > body text

Hibernate二级缓存相关属性

WBOY
Release: 2016-06-07 17:15:22
Original
1083 people have browsed it

Hibernate的SessionFactory可持有一个可选的二级缓存,通过使用这种二级缓存可以提高Hibernate的持久化访问的性能。Hibernate关于

Hibernate的SessionFactory可持有一个可选的二级缓存,通过使用这种二级缓存可以提高Hibernate的持久化访问的性能。Hibernate关于二级缓存的属性有如下几个。

  hibernate.cache.provider_class:该属性用于设置二级缓存CacheProvider的类名。

  hibernate.cache.use_minimal_puts:以频繁的读操作为代价,优化二级缓存以实现最小化写操作。在Hibernate 3中,这个设置对集群缓存非常有用,对集群缓存的实现而言,默认是开启的。

  hibernate.cache.use_query_cache:设置是否允许查询缓存。个别查询仍然需要显式设置为可缓存的。

  hibernate.cache.use_second_level_cache:用于设置是否启用二级缓存,该属性可完全禁止使用二级缓存。对那些在映射文件中指定了的持久化类,则默认开启二级缓存。

  hibernate.cache.query_cache_factory:设置查询缓存工厂的类名,,查询缓存工厂必须实现QueryCache接口。该属性值默认为内建的StandardQueryCache。

  hibernate.cache.region_prefix:设置二级缓存区名称的前缀。

  hibernate.cache.use_structured_entries:用于设置是否强制Hibernate以可读性更好的格式将数据存入二级缓存。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!