File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Bulk Insert in JPA 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Bulk Insert in JPA 2" Watch "Bulk Insert in JPA 2" New topic

Bulk Insert in JPA 2

Aalok Singh

Joined: May 27, 2010
Posts: 14
Hello Ranchers,

How to perform bulk insert in JPA 2..?


Ivan Korhner

Joined: Jan 11, 2015
Posts: 6
There are a few ways to optimize bulk insertion in Hibernate( flush manually, staless sessions, allocate ids instead of fetching everytime, etc). You can check this link for various tips with performance gains measurements:

Good luck!

Visit my blog:
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Bulk Insert in JPA 2
It's not a secret anymore!