Rohit Jadhav
Rohit Jadhav

Reputation: 165

Update Query Cache in hibernate for multiple records

Second level query cache is enabled and I am executing update query which is updating more than two records of that entity in DB.
1) Is that reflected in second level cache for that entities?
2) If they are getting cached then those entities are accessed through non-query(entity level) cache ?

Upvotes: 1

Views: 451

Answers (1)

Galder Zamarreño
Galder Zamarreño

Reputation: 5197

Any query that you have with that entity type will be invalidated whenever there's an update or insert on that entity type. This means that the query and its results get removed from the query cache, and the next time the query is executed after the update it'd be cached again. You can find a few more details in this recent response I sent.

Upvotes: 0

Related Questions