在用SpringBatch 跑job的时候出现这个错误, 由于取数据的DB 是netezza, 框架可能支持的不是很全面,当然也可能是其他原因。

<bean id="reader_rdc"
class="org.springframework.batch.item.database.JdbcCursorItemReader"
scope="step">
<property name="dataSource" ref="rdc-datasource" />
<property name="sql">
<value>
<![CDATA[
SELECT DISTINCT
C.SAP_CUSTOMER_NO,
case
WHEN C.SAP_CUSTOMER_NO > 1 THEN C.SAP_CUSTOMER_NO + 10000000000
END AS SAP_CUSTOMER_NO_11_POS,
G.IOT_NAME,
--G.IMT_NAME,
CASE
WHEN G.ISO_COUNTRY_NAME = 'United States' THEN 'United States'
ELSE G.IMT_NAME
END AS IMT_NAME,
G.ISO_COUNTRY_NAME,
C.ISSUING_COUNTRY_NO,
C.SAP_DIM_ISO_COUNTRY_CODE,
C.MANDT,
C.CUST_NAME,
C.STREET_ADDRESS,
C.CUST_CITY,
C.CUST_STATE_PROV,
C.CUST_NO,
LENGTH(C.CUST_NO) AS CUST_NUM_LENGTH,
C.CUST_COUNTY_CODE,
H.DUNS_NO,
C.ENTERPRISE_NO,
C.MKT_AFFILIATE_NO,
C.DOM_CLIENT_ID,
SUBSTRING(C.GBL_BUY_GRP_ID,1,2) AS GBG_Mnemonic,
'1' AS RECORD_COUNT,
F.LEGAL_DOM_CLIENT_NAME, -- FROM SAPR3.LEGAL_DOM_CLIENT
C.GBL_CLIENT_ID,
C.GBL_ULT_CLIENT_ID,
C.DOM_BUY_GRP_ID,
C.GBL_BUY_GRP_ID,
C.SAP_DIM_BASE_TYPE,
C.SAP_DIM_BASE_COVID,
B.COV_CLIENT_TYPE,
D.COV_CLIENT_TYPE_DESC,
J.CAP_IND,
K.AUFSD AS ORDER_NO,
S.INDUSTRY_CODE,
S.INDUSTRY_NAME
FROM CUST.SAP_COVERAGE_CUSTOMER C
LEFT OUTER JOIN CUST.SAP_DIM_COVERAGE A
ON C.SAP_DIM_BASE_COVID = A.COV_ID
AND C.SAP_DIM_BASE_TYPE = A.COV_TYPE
LEFT OUTER JOIN SAPR3.V_COVERAGE_ID_CLIENT_TYPE B
ON A.COV_TYPE = B.COVTYPE
AND A.COV_ID = B.COVID
AND C.MANDT = B.MANDT
LEFT OUTER JOIN NZCCMS.CUST_SAP_DIM_ISO_COUNTRY G
ON C.SAP_DIM_ISO_COUNTRY_CODE = G.ISO_COUNTRY_CODE
LEFT OUTER JOIN SAPR3.COVERAGE_CLIENT_TYPE D
ON B.COV_CLIENT_TYPE = D.COV_CLIENT_TYPE
AND C.MANDT = D.MANDT
LEFT OUTER JOIN SAPR3.KDUNS H
ON C.MANDT = H.MANDT
AND C.SAP_CUSTOMER_NO = H.KUNNR
LEFT OUTER JOIN SAPR3.LEGAL_DOM_CLIENT F
ON C.DOM_CLIENT_ID = F.DOM_CLIENT_ID
AND C.MANDT = F.MANDT
LEFT OUTER JOIN SAPR3.KUNNR_EXT J
ON C.MANDT = J.MANDT
AND C.SAP_CUSTOMER_NO = J.KUNNR
LEFT OUTER JOIN SAPR3.KNA1 K
ON C.MANDT = K.MANDT
AND C.SAP_CUSTOMER_NO = K.KUNNR
LEFT OUTER JOIN NZCCMS.CUST_SAP_DIM_SIC_CODE S
ON C.SAP_DIM_UNSIC_CODE = S.UNSIC_CODE
WHERE
J.CAP_IND= 'Y'
AND C.MANDT = '100'
AND K.AUFSD NOT IN('75','90','93')
AND B.COV_CLIENT_TYPE IN ('R','C','E','D')
]]>
</value>
</property>
<property name="rowMapper">
<bean class="flow.RdcMapper" />
</property>
<property name="verifyCursorPosition">
<value>false</value>
</property>

</bean>

将 verifyCursorPosition 属性设成 false 即可。

org.springframework.dao.InvalidDataAccessResourceUsageException: Unexpected cursor position change. Spring Batch 错误的更多相关文章

  1. org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

    原因: 这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列. org.springframework.dao.InvalidDataAccessApiUsageException: Pa ...

  2. 报错org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"

    org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n ...

  3. 报错:org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement

    org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n ...

  4. 【异常】Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException

    Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException ...

  5. org.springframework.dao.DataIntegrityViolationException:

    数据库用的hibernate,开发工具用的myeclipse,使用开发工具连接数据库生成hibernate基于xml的po类,运行时报org.springframework.dao.DataInteg ...

  6. javaEE-----org.springframework.dao.InvalidDataAccessApiUsageException: Write operation

    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...

  7. org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integer (n/a)];

    题记:以前记录过一些自己遇到的BUG,这个行为,让我一看报错的提示信息就能定位到问题的所在,后来记得比较多了,好多是重复性的再加上比较忙就没有详细的记录了,今天的工作量比较小,就顺便记录一下,以便以后 ...

  8. org.springframework.dao.InvalidDataAccessApiUsageException:The given object has a null identifi的解决方案

    异常信息: org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identi ...

  9. org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode

    [spring]:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowe ...

随机推荐

  1. Spring Boot入门(1)Hello World

    Spring Boot介绍   对于熟悉Spring的读者读者来说,想必也听说过Spring Boot的大名,Spring Boot旨在简化Spring的开发,它涉及了Spring的方方面面,是一个令 ...

  2. Redis中的执行命令的过程

    在redis.c的initServerConfig()方法中,通过调用dictCreate方法初始化server端的命令表.这个命令表是一个hashtable,可以通过key找到相关的命令: /* C ...

  3. Java_Comparable,Comparator两接口区别

    Comparable和Comparator的区别 根本区别 1.Comparable是一个内比较器,Comparator是一个外比较器 封装的包不同 java.util.Comparator java ...

  4. 深入理解SpringCloud与微服务构建

    旭日Follow_24 的CSDN 博客 ,全文地址请点击: https://blog.csdn.net/xuri24/article/details/81742534 目录 一.SpringClou ...

  5. JavaScript是如何工作的:Service Worker的生命周期及使用场景

    摘要: 理解Service Worker. 原文:JavaScript 是如何工作的:Service Worker 的生命周期及使用场景 作者:前端小智 Fundebug经授权转载,版权归原作者所有. ...

  6. hihoCoder编程练习赛67

    题目1 : 序列 时间限制:20000ms 单点时限:1000ms 内存限制:256MB 描述 给定两个正整数 n, P,求满足以下两个条件的长度为 n 的序列 ai 个数: 1. 1 ≤ ai ≤ ...

  7. WORLD 快速线

    1,3个“-”     一条直线 2,3个“=”    一条双直线 3,3个“*”     一条虚线 4,3个“~”     一条波浪线 5, 3个“#”    一条隔行线

  8. 替换富文本里的px为rem

    var content = '23px' content = content.replace(/(\d+)px/g, function(s, t) { s = s.replace('px', ''); ...

  9. webstorm编辑器相关

    1.怎么去掉webstorm中间那条线? 如图: 2.webstorm 常见快捷键 1.代码导航和用法查询:只需要按着Ctrl键点击函数或者变量等,就能直接跳转到定义:可以全项目查找函数或者变量,还可 ...

  10. 【代码笔记】Web-Javascript-javascript break和continue语句

    一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...