Tuesday, 13 February 2018

What is query cache in Hibernate?

QueryCache actually stores the result sets of SQL query for future calls. Query cache can be used along with second level cache for improved performance.
Hibernate support various open source caching solution to implement Query cache e.g. EhCache.
Every time the query is fired the cache manager checks for the combination of parameters and query. If the results are found in the cache they are returned otherwise a database transaction is initiated.

<property name="hibernate.cache.use_query_cache">true</property>

No comments:

Post a Comment