camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arapov, Artem" <>
Subject [2.17.0] NULLs are not allowed with named parameter in SQL component
Date Fri, 22 Apr 2016 10:28:59 GMT

I've recently tried out new 2.17.0 version from 2.16.1 and discovered a bug with named parameters
and null values in SQL component.
I use CamelSqlQuery header to set the query with named parameters as ":?param". Values for
that parameters are stored in message body (map).
Problem occurs when such map contains a NULL value for key "param" - camel throws exception
"Cannot find key [param] in message body or headers...".
When value is not null - everything working as expected. Looking at DefaultSqlPrepareStatementStrategy
class (at Github) it's quite obvious - when "lookupParameter" (line 267) function returns
null (even if key exists, but value is null!) next check (line 271) throwing error. Which
I suppose is not correct behavior.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message