title: SpringBatch(JdbcPagingItemReader) does not fetch all rows
body: <p>I have a springbatch application and I am having trouble fetching all rows using JdbcPagingItemReader.</p>
  <p>Total rows:</p>
  <pre class="lang-sql prettyprint-override"><code>select count(*) from web_view;
  </code></pre>
  <p>Results in 12057 rows.</p>
  <pre><code>datasource.chunk.size=500
  </code></pre>
  <pre class="lang-java prettyprint-override"><code>@Bean
  public PagingQueryProvider pagingQueryProvider() {
      SqlServerPagingQueryProvider sqlServerPagingQueryProvider = new SqlServerPagingQueryProvider();
      Map&lt;String, Order&gt; sortKey = new HashMap&lt;&gt;();
      sortKey.put(&quot;type&quot;, Order.ASCENDING);
      sqlServerPagingQueryProvider.setSelectClause(&quot;select *&quot;);
      sqlServerPagingQueryProvider.setFromClause(&quot;from web_view&quot;);
      sqlServerPagingQueryProvider.setSortKeys(sortKey);
      return sqlServerPagingQueryProvider;
  }
  
  @Bean
  public JdbcPagingItemReader&lt;Web&gt; jdbcPagingItemReader() throws Exception {
      return new JdbcPagingItemReaderBuilder&lt;Web&gt;()
              .name(&quot;jdbcPagingItemReader&quot;)
              .dataSource(dataSource())
              .queryProvider(pagingQueryProvider())
              .rowMapper(new BeanPropertyRowMapper&lt;&gt;(Web.class))
              .pageSize(chunkSize)
              .saveState(true)
              .build();
  }
  
  @Bean
  public Job importUserJob(JobCompletionNotificationListener jobCompletionNotificationListener, Step step1) {
      return jobBuilderFactory.get(&quot;migrateWebJob&quot;)
              .incrementer(new RunIdIncrementer())
              .listener(jobCompletionNotificationListener)
              .flow(step1)
              .end()
              .build();
  }
  @Bean
  public Step step1() throws Exception {
      return stepBuilderFactory.get(&quot;step1&quot;)
              .&lt;Web, WebStore&gt;chunk(chunkSize)
              .reader(jdbcPagingItemReader())
              .processor(webStoreItemProcessor())
              .writer(eventHubItemWriter())
              .build();
  }
  </code></pre>
  <p>It gracefully stops after 3rd paging processing only 1500 rows out of 12057.</p>