[
https://issues.apache.org/jira/browse/CAMEL-27822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-27822:
--------------------------------
Description:
Found while improving the option descriptions of camel-jdbc for CAMEL-23832
(commit
https://github.com/apache/camel/commit/f9114180c5e7be882210730be747beb6cfc38cb8,
pull request https://github.com/apache/camel/pull/31140).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. allowNamedParameters=false is ignored
{{DefaultJdbcPrepareStatementStrategy.createPopulateIterator}} checks
hasNamedParameters on the original SQL, whatever allowNamedParameters says.
With useHeadersAsParameters=true&allowNamedParameters=false, a query with a "?"
and the literal text ":?lic" fails with "Cannot find key [lic]" instead of
using CamelJdbcParameters (reproduced with H2).
Proposed change: treat the query as named only when named parameters were
replaced, or pass the flag in.
h4. 2. The error message mentions the body
"Cannot find key [x] in message body or headers": the body is never used for
the values.
Proposed change: fix the message.
_Claude Code on behalf of davsclaus_
was:
Found while improving the option descriptions of camel-jdbc for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31140).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. allowNamedParameters=false is ignored
{{DefaultJdbcPrepareStatementStrategy.createPopulateIterator}} checks
hasNamedParameters on the original SQL, whatever allowNamedParameters says.
With useHeadersAsParameters=true&allowNamedParameters=false, a query with a "?"
and the literal text ":?lic" fails with "Cannot find key [lic]" instead of
using CamelJdbcParameters (reproduced with H2).
Proposed change: treat the query as named only when named parameters were
replaced, or pass the flag in.
h4. 2. The error message mentions the body
"Cannot find key [x] in message body or headers": the body is never used for
the values.
Proposed change: fix the message.
_Claude Code on behalf of davsclaus_
> camel-jdbc: allowNamedParameters=false is ignored by the parameter iterator
> ---------------------------------------------------------------------------
>
> Key: CAMEL-27822
> URL: https://issues.apache.org/jira/browse/CAMEL-27822
> Project: Camel
> Issue Type: Bug
> Components: camel-jdbc
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-jdbc for CAMEL-23832
> (commit
> https://github.com/apache/camel/commit/f9114180c5e7be882210730be747beb6cfc38cb8,
> pull request https://github.com/apache/camel/pull/31140).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. allowNamedParameters=false is ignored
> {{DefaultJdbcPrepareStatementStrategy.createPopulateIterator}} checks
> hasNamedParameters on the original SQL, whatever allowNamedParameters says.
> With useHeadersAsParameters=true&allowNamedParameters=false, a query with a
> "?" and the literal text ":?lic" fails with "Cannot find key [lic]" instead
> of using CamelJdbcParameters (reproduced with H2).
> Proposed change: treat the query as named only when named parameters were
> replaced, or pass the flag in.
> h4. 2. The error message mentions the body
> "Cannot find key [x] in message body or headers": the body is never used for
> the values.
> Proposed change: fix the message.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)