I need to insert about 70000 records to mysql,but i found it very slow.
So i want to do it this way :
if (count % 2000 == 0) {
QueryResult.em().flush();
QueryResult.em().clear();
}
But when the insertion complete, there’s no data really insert into database.
Anyone know about this ?
You need to commit your transaciton first.
I use the following: