0 Replies Latest reply on Apr 30, 2012 5:52 AM by drackmorph

    JBoss Batch Inserts Usage

    drackmorph

      Hi,

       

       

        I am trying to use batch processing in JBoss 6.1. In order to do so, I updated my EJB persistence.xml with the property,

       

          <property name="hibernate.jdbc.batch_size" value="50"/>

       

        and updated my code accordingly,

       

      int count = 0

      for (; count < listCarTO.size(); ++count) {

          entity = (Car) Builder.buildEntity(new Car(), listCarTO.get(count));

          getEntityManager().persist(entity);

          if ( count % 50 == 0) {

            getEntityManager().flush();

            getEntityManager().clear();

          }

      }

      return count;

       

       

        How can I be certain that batching is being actually used ?