title: Spring batch - read and write to database using chunks and multi thread using taskexecutor
body: <p>my code able to read and write to database but only one chunk after that this process stops. fail to execute other chunks.</p>
  <p>here is the error looks like
  <strong>org.springframework.dao.InvalidDataAccessResourceUsageException: Unexpected cursor position change.</strong></p>
  <p>Step Implementation</p>
  <pre><code>@Bean
      public Step step(StepBuilderFactory stepBuilderFactory) throws Exception {
         ThreadPoolTaskExceutor taskExcutorInstance = new ThreadPoolTaskExceutor();
         taskExcutorInstance.setCorePoolSize(10);
         taskExcutorInstance.setMaxPoolSize(10);
  
         return stepBuilderFactory
                  .get(&quot;read from DB and Write to DB&quot;)
                  .&lt;Object, Object&gt;chunk(1000)
                  .reader(reader(null))
                  .writer(writer())
                  .taskExecutor(taskExcutorInstance)
                  .build();
      }
  </code></pre>
  <p>for reader im using JdbcCursorItemReader and for writer im using JdbcbatchItemWriter.
  I'm trying to read and write multiple chuncks at the same time</p>
  <p>if I need to disable verifyCursorPosition how exactly we need disable this ?</p>