I have a job in which: The first step is a TaskletStep which retrieves some records(approx. 150-200) from a database table into a list.
The second step retrieves data from some other table and requires the list of records retrieved in the previous step for processing.
I came across three ways to do this: 1)putting the list retrieved in first step in StepExecutionContext and then promoting it to JobExecutionContext to share data between steps.
2)using spring's caching concept i.e. using @cacheable
3)programmatically putting the list in the ApplicationContext
What is the best way to achieve this(it would be better if it can be explained with an example), keeping in mind two main concerns: if the volume of data retrieved in the first step increases and performance