2 Replies Latest reply on May 12, 2010 7:56 PM by lcbdl888

    Performance issue when insert 10000 records

    lcbdl888

      Hi, I have a simple program to insert 10,000 records into a table. It runs very fast at the very beginning. But it becomes slower and slower after a while. To insert 10000 record it costs more than one hour. What is the best way to do that? Thanks.


      public void loadT3Slip() {
        for (int i = 0; i < 10000; i++) {
          T3Slip t3slip = new T3Slip();
          t3slip.setXXX1(xxx);
          t3slip.setYYY(yyy);
          ......
          entityManager.persist(t3slip);
        }
      }