title: Batch inserts using JPA EntityManager
body: <p>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.</p>
  
  <p>Actually, for every insert operation it's taking me 300ms which I want to reduce using batch inserts instead of single inserts.</p>
  
  <p>Here's code I am using currently executing for single inserts</p>
  
  <pre><code>        @PersistenceContext(unitName = "testing")
          EntityManager eM;
  
          Query querys = this.eM.createNativeQuery(insertQuery);
          for (String s : someList) {
              //setting parameters
              querys.executeUpdate();
          }
  </code></pre>
  
  <p>Thanks in advance.</p>