Improved JdbcSelectExecutorStandardImpl#resolveJdbcValuesSource() method

This commit is contained in:
Andrea Boriero 2021-09-24 17:02:58 +02:00
parent 4a0351b157
commit e62b3710a8
1 changed files with 3 additions and 3 deletions

View File

@ -296,7 +296,7 @@ public class JdbcSelectExecutorStandardImpl implements JdbcSelectExecutor {
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
@ -348,7 +348,7 @@ public class JdbcSelectExecutorStandardImpl implements JdbcSelectExecutor {
cacheMode.name()
);
cachedResults = null;
if ( queryCacheEnabled ) {
if ( queryCacheEnabled && canBeCached ) {
queryResultsCacheKey = QueryKey.from(
jdbcSelect.getSql(),
executionContext.getQueryOptions().getLimit(),
@ -364,7 +364,7 @@ public class JdbcSelectExecutorStandardImpl implements JdbcSelectExecutor {
if ( cachedResults == null ) {
return new JdbcValuesResultSetImpl(
resultSetAccess,
canBeCached && queryCacheEnabled ? queryResultsCacheKey : null,
queryResultsCacheKey,
queryIdentifier,
executionContext.getQueryOptions(),
jdbcValuesMapping,