Batching problems

Hello,
I’m new to this forum and Clover, so I apologize if this issue is already addressed elsewhere.

There appears to be a problem with batching. The following code is in DBOutputTable.java:

if (batchCount++ % RECORDS_IN_BATCH == 0) {
try { preparedStatement.executeBatch();
preparedStatement.clearBatch();
} catch (BatchUpdateException ex) {
throw new SQLException(“Batch error:”+ex.getMessage());
}
batchCount = 0;
}

Due to the ++ on the right side of batchCount, batchCount is 0 when the if comparison is made. Since batchCount is reinitialized to 0, the if statement is always true. So… the batch is executed for each individual SQL statement.

Also, the batch size is hardcoded at 25. It would be great if this could be configurable.

Thanks for reading my post - and thanks for a good tool!

Hello !

You have found a really nasty bug which caused the batch-mode operation of DBOutputTable to be impaired.

Thanks a lot !

David.