Hi,
We are using Hibernate 3.2.5 are trying to evaluate hibernate batching vis a vis JDBC batching.
As per our results the hibernate batching takes approx 2 times the time taken by JDBC batching.
The problem is we need to commit the batches in between also so in a loop we are commiting the transaction also (batching). But for every new loop hibernate creates new prepared statements i.e. if we have 20 batches 20 prepared statements per table/entity are being created but in case of JDBC the same can be done using 1 prepared statement per table/entity.
Hibernate does reuse the prepared statements within a batch but not across batches.
Is there any way to reuse prepared statements across batches? We have also enabled prepare statement caching but that also doesn't seem to help.
Please provide inputs on this if anybody has tried/encountered this or something like this (preapred statement caching) before.
Regards,
Lalit
|