Announcement Announcement Module
Collapse
No announcement yet.
TaskletStep Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • TaskletStep

    Hi

    I am doing large amount of batch processing.In my scenario, the execution starts in the tasklet , but sometimes few jobs are not completed.

    How is threads managed in TaskletStep?

  • #2
    TaskletStep never creates any threads directly. Possibly if you have injected a TaskExecutor into one of your StepFactoryBeans then you have some background threads doing processing, but the step should always wait for them to complete or fail. You might need to provide a bit more detail of what you are doing or trying to do (e.g. some code samples).

    Comment


    • #3
      Thanks Dave for your prompt reply,
      After debugging further , what we found is , the same instance of Tasklet implementation is being given to jobs , and because of that while one job is in progress other job overwrite the previous job execution.
      We tried keeping tasklet scope as prototype, but no help.
      Here is our one portion of spring appcontext.xml
      Hoping for some clue.

      <bean id="jobLauncher" class="org.springframework.batch.core.launch.suppo rt.SimpleJobLauncher" scope="prototype">
      <property name="jobRepository" ref="jobRepository" />
      <property name="taskExecutor" ref="taskExecutor" />
      </bean>
      <bean id="threadpoolExecutor" class="org.springframework.scheduling.concurrent.T hreadPoolTaskExecutor" scope="prototype" >
      <property name="corePoolSize" value="25" />
      <property name="maxPoolSize" value="50" />
      <property name="queueCapacity" value="100" />
      </bean>

      <bean id="taskExecutor" class="org.springframework.scheduling.concurrent.C oncurrentTaskExecutor" scope="prototype" >
      <constructor-arg ref="threadpoolExecutor" />
      </bean>

      <bean id="taskletStep" abstract="true" class="org.springframework.batch.core.step.tasklet .TaskletStep" scope="prototype" >
      <property name="jobRepository" ref="jobRepository"/>
      <property name="stepListeners">
      <list>
      <ref bean="loanNumber" />
      <ref bean="docType" />
      <ref bean="batchId" />
      </list>
      </property>
      </bean>

      Comment

      Working...
      X