Hibernate Specification says that cache provider must defined block in memory for storing object. I these storing block objects are stored in it. Each block must have name and must have some additional properties.Second level cache is divided into two parts
- Object cache
- Query Cache
Object Cache:-In object ache ,object along with there relation are stored in Simplified Form.
Query Cache:-In query cache, Queries are stored along with the ID of fetched object.
For the implementation of query cache two reasons are created in memory
- In first reason query along with the value of parameter to stored as key and id of returned object are stored as value.
- In second region time stamp of query execution is stored. The Purpose of this region is to identified whether result of query is valid or not.