Is there a way where we can use batch inserts using JPA EntityManager. I know there is no direct way to achieve this but there must be some way to achieve this mechanism.
Actually, for every insert operation it's taking me 300ms which I want to reduce using batch inserts instead of single inserts.
Here's code I am using currently executing for single inserts
@PersistenceContext(unitName = "testing")
EntityManager eM;
Query querys = this.eM.createNativeQuery(insertQuery);
for (String s : someList) {
//setting parameters
querys.executeUpdate();
}
Thanks in advance.