Skip to content

Commit

Permalink
Improved JdbcSelectExecutorStandardImpl#resolveJdbcValuesSource() method
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Sep 25, 2021
1 parent 4a0351b commit e62b371
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -296,7 +296,7 @@ private JdbcValues resolveJdbcValuesSource(

final QueryKey queryResultsCacheKey;

if ( queryCacheEnabled && cacheMode.isGetEnabled() ) {
if ( queryCacheEnabled && cacheMode.isGetEnabled() && canBeCached ) {
SqlExecLogger.INSTANCE.debugf( "Reading Query result cache data per CacheMode#isGetEnabled [%s]", cacheMode.name() );

final QueryResultsCache queryCache = factory
Expand Down Expand Up @@ -348,7 +348,7 @@ private JdbcValues resolveJdbcValuesSource(
cacheMode.name()
);
cachedResults = null;
if ( queryCacheEnabled ) {
if ( queryCacheEnabled && canBeCached ) {
queryResultsCacheKey = QueryKey.from(
jdbcSelect.getSql(),
executionContext.getQueryOptions().getLimit(),
Expand All @@ -364,7 +364,7 @@ private JdbcValues resolveJdbcValuesSource(
if ( cachedResults == null ) {
return new JdbcValuesResultSetImpl(
resultSetAccess,
canBeCached && queryCacheEnabled ? queryResultsCacheKey : null,
queryResultsCacheKey,
queryIdentifier,
executionContext.getQueryOptions(),
jdbcValuesMapping,
Expand Down

0 comments on commit e62b371

Please sign in to comment.