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

  • ItemReader array

    Hello,

    I have a special need, I have a special busness step when i load many data from tables to hashtables.

    I wand to execute the data loading in parallel mode ( to optimise this step).

    I've two questions ,
    1- can we have many step that the job can execute in parallel mode and join when it's ok ?
    2- Can we have step with an array of redears or a list of readers (2, 3, ..).

    Thanks

  • #2
    1. See the parallelJob sample - I guess that may meet your needs.

    2. you can use a composite reader (step doesn't need to know there's an array of readers).

    Comment


    • #3
      Hello Robert,

      Thanks for your post, i open the the "parallelJob",
      it use
      HTML Code:
      <bean id="loading" parent="simpleStep">
      <property name="taskExecutor">
      <bean							class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
      	</property>
      		<property name="itemReader">
      			<bean
      class="org.springframework.batch.sample.item.reader.StagingItemReader">
      		<property name="lobHandler"
      								ref="lobHandler" />
      		<property name="dataSource"
      								ref="dataSource" />
      </bean>
      But i dont find the class org.springframework.core.task.SimpleAsyncTaskExecu tor anywhere,

      thanks

      Comment


      • #4
        It's ok now,
        there is a library that i have to attach to the sample project.

        I need to know how can i synchronis between list of asynchronos step, may be i can use a other step to synchronize, but i must be sure that the execution of asynchronos step dont block the execution of job.

        thanks

        Comment


        • #5
          The parallelJob executes 'chunks' in parallel, we don't provide parallel 'step' execution. If you really want to execute steps in parallel consider wrapping each step in a job and run multiple jobs in parallel or you could try implementing ParallelJob as an alternative to sequential SimpleJob.

          Comment

          Working...
          X