Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

set commit size in spring

 
Shah Hiren
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a list of 500,000 records .i am using the batch update code to insert data in database.Should i send those many records in a single batch insert? or i should use commit size to commit at interval of say 50000.how can i set commit size?

 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that what

public int getBatchSize() {
return lstSqlFinalData.size();
}

is doing? Setting the batch/commit size.

Now the question comes in what Use Case in an application needs you to insert 500,000 records into another database? Maybe look into Spring Batch to do batch processing, or maybe some ETL tool out there that does massive table inserts.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic