You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2026/04/18 19:59:00 UTC

[jira] [Assigned] (GROOVY-10547) Sql.java namedParamSqlCache map is getting populated despite the cacheNamedQueries flag

     [ https://issues.apache.org/jira/browse/GROOVY-10547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King reassigned GROOVY-10547:
----------------------------------

    Assignee: Paul King

> Sql.java namedParamSqlCache map is getting populated despite the cacheNamedQueries flag
> ---------------------------------------------------------------------------------------
>
>                 Key: GROOVY-10547
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10547
>             Project: Groovy
>          Issue Type: Bug
>          Components: SQL processing
>    Affects Versions: 2.5.16, 3.0.10, 4.0.0, 4.0.1
>            Reporter: Filip Štimac
>            Assignee: Paul King
>            Priority: Minor
>
> Flag cacheNamedQueries is used to enable/disable named query caching, but doesn't properly disable caching when false. 
> Issue is that cache maps are having new data inserted in them regardless of the flag value.
>  
> Master branch: In class groovy.sql.Sql:4567-4575:
> {code:java}
>         if (cacheNamedQueries && namedParamSqlCache.containsKey(sql)) {
>             newSql = namedParamSqlCache.get(sql);
>             propList = namedParamIndexPropCache.get(sql);
>         } else {
>             ExtractIndexAndSql extractIndexAndSql = ExtractIndexAndSql.from(sql);
>             newSql = extractIndexAndSql.getNewSql();
>             propList = extractIndexAndSql.getIndexPropList();
>             namedParamSqlCache.put(sql, newSql);
>             namedParamIndexPropCache.put(sql, propList);
>         }
> {code}
>  
> When cacheNamedQueries is false, namedParam*Cache maps shouldn't be filled with data.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)