Hibernate Cache Properties

By: Felix Viewed: 153371 times  Printer Friendly Format    


The table below lists the Hibernate Cache Properties and their purpose. For easier understanding, and example is also provided for each property.

 

Property name Purpose
hibernate.cache.provider_class The classname of a custom CacheProvider.

e.g. classname.of.CacheProvider

hibernate.cache.use_minimal_puts Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This setting is most useful for clustered caches and, in Hibernate3, is enabled by default for clustered cache implementations. 

e.g. true|false

hibernate.cache.use_query_cache Enables the query cache. Individual queries still have to be set cachable. 

e.g. true|false

hibernate.cache.
use_second_level_cache
Can be used to completely disable the second level cache, which is enabled by default for classes which specify a <cache> mapping.

e.g. true|false

hibernate.cache.query_cache_factory The classname of a custom QueryCache interface, defaults to the built-in StandardQueryCache.

e.g. classname.of.QueryCache

hibernate.cache.region_prefix A prefix to use for second-level cache region names.

e.g. prefix

hibernate.cache.use_structured_entries Forces Hibernate to store data in the second-level cache in a more human-friendly format. 

e.g.true|false

hibernate.cache.
default_cache_concurrency_strategy
Setting used to give the name of the defaultorg.hibernate.annotations.CacheConcurrencyStrategy to use when either @Cacheable or @Cache is used.@Cache(strategy="..") is used to override this default.


Most Viewed Articles (in Hibernate )

Latest Articles (in Hibernate)

Comment on this tutorial