Hi
I am using ibatis for my sql insert stmt. In my code i am parsing files line by line from a folder. Each line that matches criteria, need to be inserted into database. Total number of insert in a single run of program can be any where along 200k.
SqlSession sess = null;
this.sess = sf.openSession(ExecutorType.BATCH, false);
for (each file) {
for( each line matching criteria ){
this.sess.insert("com.logs.util.insertFileInfo", fileData);
insertcount++;
if(insert count == 10)
this.sess.commit();
}
}
if(insert count > 0){
this.sess.commit();
}
}
This style slowly takes up lot of memory and after some times throws OutOfMemory exception. How can i improve performance here.