Batch inserts using JPA EntityManager
Depending on whether the transaction encloses the loop, batching typically already happens in your case. JPA will collect all your updates in its L1 cache, and typically write that all to the DB in a batch when the transaction commits. This is not really that different with batching in JDBC, where every batch-item you add … Read more