[
https://issues.apache.org/jira/browse/CAMEL-26148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136578#comment-18136578
]
Claus Ibsen commented on CAMEL-26148:
-------------------------------------
PR: https://github.com/apache/camel/pull/28918
With batch=true, sql-stored now adds only the known (positive) update counts,
so SUCCESS_NO_INFO no longer makes the header negative. A single Map body (or
CamelSqlStoredParameters header) is now one batch item. Docs and upgrade guide
updated.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
> camel-sql - sql-stored with batch=true reports a negative update count, and a
> single Map body fails with an unclear SQLException
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26148
> URL: https://issues.apache.org/jira/browse/CAMEL-26148
> Project: Camel
> Issue Type: Bug
> Components: camel-sql
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of sql-stored (CAMEL-24961, PR
> #28393).
> h4. 1. With batch=true, CamelSqlStoredUpdateCount can be negative
> {{SqlStoredProducer}} (main 2a465aa4814c, lines 75-80) sums the counts
> returned by {{executeBatch}} into {{CamelSqlStoredUpdateCount}}. A driver may
> return {{Statement.SUCCESS_NO_INFO}} (-2) for each item, so a batch of 2
> items reports -4. Checked on 4.24.0-SNAPSHOT with HSQLDB stored procedures.
> Proposed: do not add SUCCESS_NO_INFO (or other negative) values to the total,
> and document what the header means then.
> h4. 2. With batch=true, a single Map body iterates the map entries
> {{SqlStoredProducer}} (main 2a465aa4814c, line 53) gets the batch items with
> {{getBody(Iterator.class)}}. A single Map body is turned into an iterator of
> its entries, so each entry is used as a batch item and the call fails with an
> SQLException that does not point to the body. Checked on 4.24.0-SNAPSHOT with
> HSQLDB stored procedures.
> Proposed: treat a single Map body as one batch item, or fail with a message
> that batch=true expects a List or Iterator of Maps.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)