2

I have thousands of SELECT statements that are executed one after the other, and it takes a lot of time in doing this(the query can be seen below), quering the DB multiple times, and also it is not possible to have a single query.

Query q = mEntityManager.createNativeQuery(newQuery);           
List<Object> results = q.getResultList();

These statemenmts go inside a dynamic loop, which creates thousands of queries, is there a way to run them in batches, like we do it for insert and delete ?

rd22
  • 1,032
  • 1
  • 18
  • 34
  • for batch insert refer [this](http://stackoverflow.com/questions/20285347/massive-insert-with-jpa-hibernate) – rd22 Mar 13 '15 at 15:38

0 Answers0