|
Execution of batch statements generates a misleading log info when the hibernate.jdbc.batch_size <= 'current batch size'. There are two different behaviours: if (hibernate.jdbc.batch_size == 'current batch size') the log generated tell us "No batched statements to execute" (BatchingBatch.doExecuteBacth())
if(hibernate.jdbc.batch_size < 'current batch size') the log generated tell us "Executing batch size: x" with 'x' being the difference between 'current batch size' and hibernate.jdbc.batch_size.
I think it's because in BatchingBatch.addToBacth() we have: ... if ( batchPosition == batchSize ) { notifyObserversImplicitExecution(); performExecution(); batchPosition = 0; }
...
And this execution is not being logged. If the logging about "Executing batch size: x" is performed inside BatchingBatch.performExecution() method instead of BatchingBatch.doExecuteBatch(), the log generated is consistent.
Regards. Hernán. I'll try to attach the test case soon.
|