-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DirectQuerySender query without parameters fails if parameters are defined in pipe #1098
Comments
To solve this, the JdbcQuerySender should retrieve the number of parameters from the prepared query, and may be even apply the parameters by name instead of by position |
In my configuration I already apply them by name via useNamedParams. |
The problem is in MessageSendingPipe, that tries to pass on pipe parameters to the sender by overriding the addParam() method. This fails when the pipe parameters are specified before the sender itself. This will be fixed shortly. Workaround is to specify the pipe-parameters as Sender parameters, or after the sender. |
I already define them as Sender parameters, so the workaround would not work. For my configurations I found a way around this issue as there is a parameter that is present in all queries which was already set in the .xslt that made the query (integer, so no risk of injection), I changed that so that the sender also has to set that parameter. |
Describe the bug
When using a DirectQuerySender with parameters defined, it fails with the following message if the query does not require any parameters:
got exception sending message: (SQLException) SQLState [99999], errorCode [17003]: Invalid column index
In the logging this is shown:
2020-09-25 14:50:35,954 DEBUG [http-bio-80-exec-5] [mid [testmessage0a7215b8-5269be6c_174c55049bd_-7ffe]] util.JdbcUtil - jdbc parameter [1] applying parameter [ID] value [null]
Executing the same query via Execute Query does not give any problems, so it really is something with the DirectQuerySender.
The reason the DirectQuerySender has parameters but can get a query that does not require any, is because it is part of an API where all url parameters are optional. To allow database optimization, the database query is generated to only use the url parameters that are actually provided, which might result in a query without any parameters.
Reporter
Ricardo
Category
Use following Tags to categorize your bug report
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The query to be executed as is.
Screenshots
N/A
Environment:
Additional context
N/A
The text was updated successfully, but these errors were encountered: