-
Apr 8th, 2010, 08:42 AM
#1
Doubt in Step Execution
Hi,
I am new to Spring Batch Framework. I am trying couple of programs.
My requirement is:
1. Move data from table A to table B after performing some operations on table A's data.
2. Say there are 1 million records in Table A. I should read 10000 records at a time, perform some operations on this and insert into table B. This should repeat for 1 million records.
My question is:
How the same step is executed till 1 million records is processed.
My code is:
<job id="sampleJob" job-repository="jobRepository">
<step id="step1">
<tasklet transaction-manager="transactionManager">
<chunk ref="itemReader" writer="itemWriter" commit-interval="10000"/>
<tasklet>
</step>
</job>
-
Apr 8th, 2010, 09:14 AM
#2
your item reader will read items from table A. Since you requested a chunk of 1000 elements, the framework will commit the transaction every 1000 elements.
When your item reader has read the last element, the next call to it will return null. This indicates that there are no more items to process. Spring Batch offers out-of-the-box database readers (and writers).
This might help as well:
http://static.springsource.org/sprin...ntedProcessing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules