0 Replies Latest reply: Apr 30, 2012 5:52 AM by Fabio Casa RSS

JBoss Batch Inserts Usage

Fabio Casa Newbie

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 ?