I am not able to understand the exact use of UpdateTimestampsCache in ehCache ? I googled a lot but haven't anything except below statement.
Tracks the time stamps of the most recent updates to particular tables.
But whats the role of UpdateTimestampsCache in second level cache ?
When you use the Hibernate query cache (i.e. the one that stores the results from queries), it will use this cache store the time stamps of the most recent updates to tables. It then can compare the time at which each table was last updated and when the query's result was cached. If the query's result was cached and the tables haven't changed, it's safe to return the cached result. If, on the other hand, there has been changes to the tables involved in the query since the result was cached, we can't know for sure the result is still correct and the cached result will be discarded and hit the DB instead... I hope this makes some sense.
Know that, because of the cost of maintaining the UpdateTimestampsCache
, it may be less efficient to use the query cache... especially in cases where data in tables change a lot...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With