A, Hibernate secondary cache
1.1 features like cache
- The bulk of the cache object data.
1.2 features a collection of buffer zone:
- Is cached object id. Buffer need to rely on configuration class.
1.3 secondary cache data to disk
Update timestamp area
Second, the three-level cache query cache :( ??)
- More powerful than the secondary cache, and the query cache must rely on second-level cache.
- Secondary cache: cache class / object.
The query cache: cache for class attributes.
Query cache configuration:
- Configure the query cache:
- Provided that the secondary cache has been configured.
- In the core configuration file:
<!-- 配置查询缓存 --> <property name="hibernate.cache.use_query_cache">true</property>