Elliott
Elliott

Reputation: 5609

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

Upvotes: 1

Views: 819

Answers (1)

StanislavL
StanislavL

Reputation: 57381

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 e.g. commit each 100 inserts.

Upvotes: 1

Related Questions