I try to do Batch inserts with JDBC to a Crate instance:
for(...) {
statement.setLong(1, startTime);
statement.setInt(2, i);
...
statement.addBatch();
}
results = uaStatement.executeBatch();
logger.info("Had bulk-result: " + Arrays.toString(results));
The resulting int[] array should contain 0 or 1 depending if the row was inserted or not.
But I get back lots of "-3", which neither the JDBC standard nor the doc seems to define.
It seems the rows don't get inserted when -3 is returned, but no additional error information is visible. It seems the -3 is coming directly from the Crate server and the client-side JDBC implementation just forwards this.
This is crate 2.3.3 with JDBC driver 2.2.0
compile 'io.crate:crate-jdbc:2.2.0'
What does this indicate? Some problem with the sent values?
Had bulk-result: [1, 1, 1, 1, -3, -3, -3, -3, -3, -3, 1, -3, -3, -3, -3, -3, -3, ...