Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Spring and the fly likes set commit size in spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Spring
Bookmark "set commit size in spring" Watch "set commit size in spring" New topic

set commit size in spring

Shah Hiren

Joined: Jul 28, 2007
Posts: 21
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 can i set commit size?

SCJP 1.4, SCWCD 1.4
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

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.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: set commit size in spring
It's not a secret anymore!