spring-boot - 春季批处理阅读器中的读取计数小于源计数
问题描述
我正在使用 Spring Batch with Spring Boot。从源读取表并写入目标。我正在填充三个表,其中一个表的读取计数小于实际值。
说在源表中有 2656274 行但我得到的读取计数是 readCount=2577203, writeCount=2577203
其他有 8 个缺少记录和 10 k 记录工作正常的表
public class DxDatabaseItemReader extends JdbcCursorItemReader<DxDataRead> {
public DxDatabaseItemReader(DxJobContext jobCntx) {
synchronized (this){
System.err.print("Into DxDatabaseItemReader");
String[] dsParam =jobCntx.srcDbName.split("#");
this.setDataSource(createOracleDataSource(dsParam[1],dsParam[2],dsParam[3]));
this.setSql(createFetchQuery(jobCntx.srcFieldNames,jobCntx.srcTableName));//"SELECT SOEID, FST_NAM, LST_NAM FROM REF_PRSNL_MSTR");
this.setFetchSize(0);
this.setRowMapper((ResultSet rs, int rowNum) -> {
Map<String, String> fieldNameMap = new HashMap<>();
for(int i=0;i<jobCntx.srcFieldNames.size();i++)
fieldNameMap.put(getSrcFieldName(jobCntx.srcFieldNames, i), rs.getString(jobCntx.srcFieldNames.get(i)));
DxDataRead dataRead = new DxDataRead();
dataRead.setFieldNameMap(fieldNameMap);
return dataRead;
});
}
}
预期:它应该读取所有数据并写入
解决方案
推荐阅读
- javascript - 谷歌脚本代码将运行但不会执行 if 语句
- python - 为什么在整个项目中从未调用过的 LPTHW 的 ex43.py 的所有类中都有 def enter(self): 函数?
- javascript - 如何在 mongoDB 中创建增量自定义 ID
- css - 为什么我的更改没有反映在 css 中?Django 引导程序
- flutter - 你会如何从 Flutter 网站下载文件?
- python - Apache Ignite C++ 结构到 Pyignite 对象不起作用
- google-apps-script - Google Apps Script Compare Active User to Array
- r - 如何更改 statebins 地图的颜色?
- symfony - Symfony 控制台部分未清除所有行
- python-3.x - How to print class variables in a list