Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawbacks of a high hibernate.jdbc.batch_size setting

I increased the hibernate.jdbc.batch_size parameter to 50. This makes batch processings in our application a lot faster, which is great. Do I need to expect any drawbacks for the "regular" tasks of the application? The application responds to web requests and uses a single database connection per request. Most of the requests read only from the database, some requests save a few objects (but not hundreds).

Thank you very much for sharing your experiences.

like image 786
Matthias Wuttke Avatar asked Oct 22 '14 19:10

Matthias Wuttke


1 Answers

The hibernate.jdbc.batch_size parameter determines how many statements are send to the database in one call. Having to many statements (a higher number) could result in either an OutOfMemoryException or a timeout on the transaction, when doing multiple statements in a transaction.

With webrequests you usually have less statements in a transaction. This setting shouldn't influence these transactions.

Depending on which part of the documentation you read, anywhere between 10 and 50 Hibernate 3.3 chapter 13 or 5 and 30 Hibernate 3.3 chapter 3 is reasonable / recommended.

like image 118
Erwin de Gier Avatar answered Oct 16 '22 05:10

Erwin de Gier