[ 
https://issues.apache.org/jira/browse/IGNITE-5738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16118106#comment-16118106
 ] 

Vladimir Ozerov commented on IGNITE-5738:
-----------------------------------------

[~skalashnikov], my comments:
1) {{JdbcStatement.doBatchUpdate}} - why do we return {{long[]}} instead of 
{{int[]}}? It is correct that in ceratin cases 4 bytes would be not enough. 
E.g. this is why we added {{IgniteCache.sizeLong}} method. However, in this 
particular place we work with JDBC, and it's interface is very clear - updated 
counter is int. That said, we simply pass unnecessary bytes over a wire. I 
propose to change it to int[], and handle overflow on the server side properly 
(e.g. return Interge.MAX_VALUE + print a warning to a server log).
2) {{JdbcStatement.doBatchUpdate}} - why do we bother with List -> array 
conversions? Looks unnecessary to me.
3) {{JdbcPreparedStatement}} - passing flat array of arguments looks dangerous 
to me. E.g. what if I have 5 arguments, but due to code error I added 4 arg 
first time, and 6 args second time? Sum will be correct, but usage is incorrect 
and exception should be thrown. Moreover, if invalid argument count is passed 
once, the rest queries must pass without errors. That said, we should pass 
individual argument collections to individual queries. I propose to handle both 
{{Statemtnt}} and {{PreparedStatement}} in a single {{BatchTask}}. Please see 
how we did that in thin driver.

> Add support of batch requests for jdbc2
> ---------------------------------------
>
>                 Key: IGNITE-5738
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5738
>             Project: Ignite
>          Issue Type: New Feature
>          Components: jdbc
>            Reporter: Evgenii Zhuravlev
>            Assignee: Sergey Kalashnikov
>             Fix For: 2.2
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to