简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM