• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

set commit size in spring

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic