Package org.hibernate.cache.spi
Interface TimestampsCache
- All Known Implementing Classes:
TimestampsCacheDisabledImpl
,TimestampsCacheEnabledImpl
public interface TimestampsCache
Tracks invalidation of "query spaces" (tables) for the purpose of
determining if a cached query result set is stale. Implementations
use a special region the second-level
cache to store invalidation timestamps.
- A query space is invalidated in the
TimestampsCache
when a SQL DML statement executed by Hibernate affects the corresponding table. - A cached query result set is checked for
staleness against the
TimestampsCache
when it is read from aQueryResultsRegion
by aQueryResultsCache
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
clear()
default void
destroy()
The region used to store all timestamp data.void
invalidate
(String[] spaces, SharedSessionContractImplementor session) Perform invalidation of the passed spaces (table names) against the timestamp region data.boolean
isUpToDate
(String[] spaces, Long timestamp, SharedSessionContractImplementor session) Perform an up-to-date check for the given set of query spaces as part of verifying the validity of cached query results.boolean
isUpToDate
(Collection<String> spaces, Long timestamp, SharedSessionContractImplementor session) Perform an up-to-date check for the given set of query spaces as part of verifying the validity of cached query results.void
preInvalidate
(String[] spaces, SharedSessionContractImplementor session) Perform pre-invalidation of the passed spaces (table names) against the timestamp region data.
-
Method Details
-
getRegion
TimestampsRegion getRegion()The region used to store all timestamp data. -
clear
- Throws:
CacheException
-
destroy
default void destroy()
-