ing-bank / cassandra-jdbc-wrapper

A JDBC wrapper of Java Driver for Apache Cassandra®, which offers a simple JDBC compliant API to work with CQL3.
Apache License 2.0
74 stars 25 forks source link

Wrong return count in executeBatch() #63

Closed stefanofornari closed 5 months ago

stefanofornari commented 5 months ago

The current implementation of executeBatch() returns a wrong number of effected rows given the underlying driver does not provide such information. In the line below, rowCounts[] is updated with 1 for each statement in batch:

https://github.com/ing-bank/cassandra-jdbc-wrapper/blob/3ab76c07bf043cf93670b636452e0b4de53af29c/src/main/java/com/ing/data/cassandra/jdbc/CassandraPreparedStatement.java#L282

Accordingly to executeBatch() javadoc it should be updated with SUCCESS_NO_INFO.

maximevw commented 5 months ago

Good catch @stefanofornari, I'll fix this asap.

maximevw commented 5 months ago

Will be fixed in the next release (see commit https://github.com/ing-bank/cassandra-jdbc-wrapper/commit/40f81093875331c967026c1de4fd2dbf5bc31219).