I am writing a spring batch job. The job reads from a database, does some processing and then writes to a file.
It works single threaded without a partition step. So far so good.
I now want to enhance the job to add a Partitioner and read the rows from the database partitioned by the values in a particular column.
This is the code I have so far...
When I try and execute it I get the error below.
java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.readStgDbAndExportMasterListStep': Scope 'job' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No context holder available for job scope
The full error can be seen here...
Can someone assist me with understanding what parts of a job need to be in step scope and what parts of a job need to be defined as JobScope especially in my use case where I am trying to multi-thread my jobs so as to help me resolve this?
thanks