Jul 16th, 2010, 05:53 AM
How to initialise per job rather than per item?
How would one go about executing code on a per job basis rather than per item?
For example, if you wanted to send an email for each row returned from a DB call. So you process each row as an item, but the email template is the same for each person (which let's just say is retrieved/concocted using some non-trivial processing) so you only want to call that once as opposed to for each item n number of times.
Is there a common strategy for this kind of scenario using Spring Batch?
Thanks in advance,
Jul 16th, 2010, 06:53 AM
One answer is using a Tasklet and just do all the processing in one place. Any others though?