Announcement Announcement Module
No announcement yet.
Problem with Job and Steps Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Job and Steps

    Hi All

    I have to delete all the records from the DB if there is a file at a given path before processing the record of new file else don't delete the record from DB.

    delete the existing records from a table ABC Then process new file
    else {
    Don't delete the existing records from ABC table.

    Can any one suggest me some solution how to make my job in different steps.

    Below is the piece of code. I am executing my batch through command prompt.

    <job id="paymentRecordLoadJob" xmlns="">
    		<step id="paymentRecordLoad" >
    				<chunk reader="paymentRecordReader" writer="paymentRecordWriter" 
    	                   commit-interval="2" skip-limit="10000">
    			         		<include class="org.springframework.dao.DuplicateKeyException"/>
    			         		<include class=""/>
    Within this job i have to manage that if else condition.

  • #2
    You could use the conditional support provided by Spring batch. You can have a step to check the if the file exists, the step can return a status based on this. The subsequent steps can be called based on the returned status.