Skip to content
Advertisement

Tag: spring-batch

Spring Batch restart persistent jobs after abnormal termination

I have a following Spring Batch Job config: I’m starting the job with a following code: This is my test tasklet: I use H2 database as a persistent storage for my jobs. During the jobs execution I’m terminating my application. Right after application restart I expect that all uncompleted jobs will continue execution from terminated steps but nothing happens. Also,

Spring batch FileItemWriter not creating file at correct path

I have a spring batch service containing a FileItemReader,FileItemProcessor and FileItemWriter.When creating the FileItemWriter I have to set the Resource that will be my output file. I am running the batch service on websphere on a Linux machine.The problem is if I set the resource as new FileSystemResource(new File(“opttemp1myFile.txt”)), the path of the file created is “/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/opttempmyFile.txt” which is not

Spring Batch Item Reader is executing only once

Trying to implement Spring batch,but facing a strange problem,Our ItemReader class is executing only once. Here below is the detail. If we have 1000 rows in DB. Our Item reader fetch 1000 rows from DB,and pass list to ItemWriter ItemWriter successfully delete all items. Now ItemReader again tries to fetch the data from DB,but did not find,hence returns NULL,so execution

Advertisement