Closed
Description
David Geary opened BATCH-2269 and commented
Attempting to access a JobScope bean from a worker thread in a thread pool as part of a multi-threaded or partitioned step gives the following exception
Caused by: java.lang.IllegalStateException: No context holder available for job scope
at org.springframework.batch.core.scope.JobScope.getContext(JobScope.java:153)
at org.springframework.batch.core.scope.JobScope.get(JobScope.java:92)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:338)
This is due to the fact the JobExecution is stored in a ThreadLocal and it isn't set up on the worker threads.
Affects: 3.0.1
Reference URL: http://stackoverflow.com/questions/24558703/multi-threaded-acces-to-job-scope-beans-in-spring-batch-3-0
18 votes, 21 watchers