Multiple choice technology programming languages

How to enable query cache in hibernate

  1. a) hibernate.cache.query_cache true

  2. b) hibernate.cache.use_query_cache true

  3. c) hibernate.cache.query_cache yes

  4. d) none

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To enable query cache in Hibernate, you set the property hibernate.cache.use_query_cache to true (not 'yes' or without the 'use_' prefix). This property, along with configuring a second-level cache provider, enables caching of query result sets. Option B correctly states the property name and value. Options A and C are incorrect because they use 'query_cache' instead of 'use_query_cache'. Option D is wrong because query cache can be enabled with the correct property.