Level 2 Cache and Query Cache

What will happened if level 2 cache is enable and query cache is diabled in Hibernate?

Questions by RamRihal

Showing Answers 1 - 6 of 6 Answers

sowdri

  • Jan 29th, 2011
 

Query cache depends on L2 cache.
L2 cache does not depend on query cache.
So nothing would happen.


Alternatively:
What will happened if level 2 cache is disabled and query cache is enabled in
Hibernate?


Answer:  Hibernate query can return both value types and entity types.

Query cache saves the id of entity types and complete value types.
When the same query is executed again, value types and entity type ids are
fetched from query cache.
From L2 cache, entity types are fetched using the ids.
so, if L2 cache is disabled, the entities are looked up from the database using
SQL queries using the IDs.


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions