insert many Entities via JPA - good Idea?
843859Jun 15 2010 — edited Nov 20 2014(i didn't found a jpa/data tier subforum, if there is one move this please)
i am writing a db-application. One part is for interacting withe db (viewing, updating Entries) and another Part is for importing Data from different sources into DB (probably also exporting to xml,csv). Because i never used JPA i gave it a try and mapped the DB to entity classes. For manipulating and persisting single entities jpa seems to be a good choice. But what if i want to insert a great number of Instances? Each em.persist will cause one insert query, is this right? Is there a jpa way to bundle such batch inserts?
or is it better to write import/export classes that rely on jdbc? in my special case abaut 10k entries will be inserted at once.