简体   繁体   中英

Hibernate performance optimization during inserts

We recently increased the size of one of the arrays that our java application is using and now the performance has degraded significantly. We are seeing that the performance problem is specifically due to a database insertion done through hibernate. We are doing a single insertion of a single record and its taking upwards to a minute to complete the insert! I'm wondering if there is something not configured correctly that would cause this situation and whether there is a ready solution.

Thanks,

Elliott

Try to set batch size parameter for your hibernate. That will allow yu to call multiple insert in one DB change.

Also check whether all the inserts happens in the same transaction. Try to eg commit each 100 inserts.

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