ItemReader reader() in infinite loop
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I implemented ItemReader with JdbcTemplate . The problem is that read() is being invoked in infinite loop. public class MyReader implements ItemReader < Col >, InitializingBean { private JdbcTemplate jdbcTemplate ; private RowMapper < Col > rowMapper ; private String sql ; private DataSource dataSource ; public Col read () throws Exception , UnexpectedInputException , ParseException , NonTransientResourceException { Col col = jdbcTemplate . queryForObject ( sql , null , rowMapper ); return col ; } } Spring batch configuration: