-
Apr 23rd, 2010, 04:07 AM
#1
how to run same batch job with same params twice
I have a batch job which has the name of the file that is going to be processed as a late binding parameter. I want to process the file through spring batch twice. (this is a business requirement, dont ask me why please).
The first time the file is processed with a exit code of completed. The second time the file is processed i get the exception
org.springframework.batch.core.repository.JobInsta nceAlreadyCompleteException: A job instance already exists and is complete for parameters={input.file.name=classpath:TestDefects. csv}. If you want to run this job again, change the parameters.
So is there a configuration change that can be made which will allow the file to be processed twice without having to change the input params.
Thanks in advance
-
Apr 23rd, 2010, 10:01 AM
#2
Nope, you'll have to pass a param because the "identity" of a job instance is the parameters for which it was called. Typically we'll include the current date/time in this case if we don't have some sort of business value that could be used.
-
Apr 26th, 2010, 11:03 AM
#3
I am new to SB, but my 2 cents.
Just add an extra random parameter like a=1 and you can run that same job with those parameters again.
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