Quote:
Does this save action makes all the previously cached movies data to become invalidated?
No. But the cached-query-result will become invalidated.
Quote:
How does the cache invalidation mechanism work?
Doing the insert on "Rambo" in Movies, hibernate will update UpdateTimestampsCache.
UpdateTimestampsCache expressed in poor words is a cached table with columns tablename and lastUpdate.
Doing the insert on "Rambo" in Movies, hibernate will update UpdateTimestampsCache by writing values
"Movies"|<timestamp> in the cached table.
When you then re-execute the cached query, hibernate recognizes that the cached result-set is older
than concerning timestamp in UpdateTimestampsCache (hibernate checks up-to-dateness of all query-involved tables),
thus the cached result-set get invalidated.