J'utilise jpa eclipselink pour la base de données mysql, j'ai besoin d'insérer en bloc une liste contenant plus de 6000 objets. Mais seulement 215 lignes sont insérées dans la base de données et aucune exception n'est levée.insert en vrac utilisant jpa eclipselink
ici est mon code
private EntityManagerFactory emf = null;
private static final String PERSISTENCE_UNIT_NAME = "Cation";
private static EntityManagerFactory factory;
public EntityManager getEntityManager() {
return emf.createEntityManager();
}
factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
EntityManager em = factory.createEntityManager();
try {
em.getTransaction().begin();
for (int i = 0; i < sgmlList.size(); i++) {
// Getting the object from the list by using loop
SGML sgml = sgmlList.get(i);
em.persist(sgml);
}
em.getTransaction().commit();
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage("SGML imported successfully"));
} catch (Exception ex) {
} finally {
if (em != null) {
em.close();
}
}
quelqu'un peut me aider à résoudre ce problème plz.