hibernate/hibernate-orm · error · IllegalStateException
Cache storage not supported
Error message
Cache storage not supported
What it means
Error "Cache storage not supported" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/internal/AbstractQuery.java:454
@Override
@Nonnull
public CacheRetrieveMode getCacheRetrieveMode() {
throw new IllegalStateException( "Cache retrieval not supported" );
}
@Override
@Nonnull
public QueryImplementor<T> setCacheRetrieveMode(@Nonnull CacheRetrieveMode cacheRetrieveMode) {
verifySelectionOption( "Result caching" );
super.setCacheRetrieveMode( cacheRetrieveMode );
return this;
}
@Override
@Nonnull
public CacheStoreMode getCacheStoreMode() {
throw new IllegalStateException( "Cache storage not supported" );
}
@Override
@Nonnull
public QueryImplementor<T> setCacheStoreMode(@Nonnull CacheStoreMode cacheStoreMode) {
verifySelectionOption( "Result caching" );
super.setCacheStoreMode( cacheStoreMode );
return this;
}
@Override @SuppressWarnings("removal")
@Nullable
public LockModeType getLockMode() {
return queryOptions.getLockOptions().getLockMode().toJpaLockMode();
}
@Override
@NonnullView on GitHub (pinned to fad1729dce)
Solutions
- Cache storage (CacheStoreMode) is not supported for this query kind. Do not set a cache store mode here.
When it happens
Trigger: Query caching is used in an unsupported way: Cache storage not supported
Common situations: Enabling result-set caching on historical (audit) queries, or using cache modes the query does not support.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/579f21a1e0e45af7.
Report an issue: GitHub.