쿼리서비스에서 findWithRowCount로 페이지를 조회시 오류가 발생합니다.
안녕하십니까.
우정사업정보센터 IT종합상황관리시스템을 구축하고 있는 김종헌입니다.
쿼리서비스에서 findWithRowCount로 페이지를 조회하는데 값이 없는경우
아래와 같은 TJDBC-90624 오류가 발생합니다.
오라클에서 테스트를 하니 정상적으로 리턴이 되는데 티베로에서는 에러가 발생합니다.
티베로의 드라이버가 문제인지 잘 모르겠습니다.
빠른 답변부탁드립니다.
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [-90624]; TJDBC-90624:cursor is not in valid position - getRow; nested exception is com.tmax.tibero.jdbc.TbSQLException: TJDBC-90624:cursor is not in valid position - getRow
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:604)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:638)
at anyframe.core.query.impl.SQLPagingJdbcTemplate.queryWithPagination(SQLPagingJdbcTemplate.java:70)
at anyframe.core.query.impl.PagingNamedParamJdbcTemplate.query(PagingNamedParamJdbcTemplate.java:59)
at anyframe.core.query.impl.ExtendedQueryServiceImpl.findInternal(ExtendedQueryServiceImpl.java:704)
at anyframe.core.query.impl.ExtendedQueryServiceImpl.findWithRowCount(ExtendedQueryServiceImpl.java:981)
at anyframe.core.query.impl.ExtendedQueryServiceImpl.findWithRowCount(ExtendedQueryServiceImpl.java:962)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at anyframe.common.aop.aspects.ApiAspect.invoke(ApiAspect.java:40)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy182.findWithRowCount(Unknown Source)
at com.sds.itpm.AbstractDao.findListWithPaging(Unknown Source)
at com.sds.itpm.AbstractDao.findListWithPaging(Unknown Source)
at com.sds.itpm.quality.dao.PmQmc01tDao.getQualityManagementList(Unknown Source)
at com.sds.itpm.quality.impl.QualityManagementServiceImpl.getQualityManagementList(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy308.getQualityManagementList(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at anyframe.common.aop.aspects.ApiAspect.invoke(ApiAspect.java:40)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy309.getQualityManagementList(Unknown Source)
at com.sds.itpm.quality.QualityManagementList.setQualityManagementList(Unknown Source)
at jeus_jspwork._jsp._quality._600_QualityManagementList_5fjsp._jspService(_600_QualityManagementList_5fjsp.java:137)
at jeus.servlet.jsp2.runtime.HttpJspBase.service(HttpJspBase.java:106)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:818)
at jeus.servlet.jsp.JspServletWrapper.executeServlet(JspServletWrapper.java:101)
at jeus.servlet.servlets.JspServlet.executeServlet(JspServlet.java:423)
at jeus.servlet.engine.RequestDispatcherImpl.processCommonRequestDispatcher(RequestDispatcherImpl.java:509)
at jeus.servlet.engine.RequestDispatcherImpl.doInclude(RequestDispatcherImpl.java:665)
at jeus.servlet.engine.RequestDispatcherImpl.include(RequestDispatcherImpl.java:613)
at com.sds.itpm.controller.MainFrontController.requestBody(Unknown Source)
at com.sds.itpm.controller.MainFrontController.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:705)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:818)
at jeus.servlet.engine.ServletWrapper.executeServlet(ServletWrapper.java:326)
at jeus.servlet.engine.ServletWrapper.execute(ServletWrapper.java:220)
at jeus.servlet.engine.HttpRequestProcessor.run(HttpRequestProcessor.java:277)
Caused by: com.tmax.tibero.jdbc.TbSQLException: TJDBC-90624:cursor is not in valid position - getRow
at com.tmax.tibero.jdbc.TbResultSetBase.getRow(TbResultSetBase.java:534)
at anyframe.core.query.impl.SQLPagingJdbcTemplate$PagingRowCallbackHandlerResultSetExtractor.extractData(SQLPagingJdbcTemplate.java:195)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:650)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:588)
... 61 more


findWithRowCount로 페이지를 조회시 오류가 발생
쿼리 서비스 속성 정의 XML 파일의 내용을 알고 싶습니다. 현재 정의된 내용을 덧붙여 주세요.
쿼리서비스 정의내용입니다.
<?xml version="1.0" encoding="UTF-8"?>
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.sds.samsung.com/schema/service http://www.sds.samsung.com/schema/service/anyframe-service-2.0.xsd">
classpath:/itpm/sql/**/*.xml
[의견] cusor 문제라면 driver 측일 듯
paging 시에 anyframe query service에서
원래 sql을 페이징 조건이 붙은 sql 문으로 변경해서 날립니다.
만약 sql 문법 에러가 났다면 db 제품 의존적인 sql문이 생성되었다고 생각하고
paging generator의 티베로 확장이 필요하겠지만
에러 내용을 봤을 때 cursor 관련 에러라면
티베로의 jdbc driver 측에서 개선이 되어야할 것 같습니다.
결국 anyframe도 그 하위에 jdbc driver를 사용할테니까요
db 버전, 제품 변경 시 발생하는
transaction, blob, resultset 조작 시 에러는
대부분 jdbc driver에서 발생하더군요.
페이징된 결과 sql문을
개발팀에 문의하여 얻은 후에 직접 jdbc로 호출했을 때
티베로에서 실행이 되는지를 먼저보면 (anyframe을 사용하지 않은 상태)
좀 더 정확한 원인을 찾을 수 있을 것 같습니다.
만약 이 상태에서도 같은 증상이라면
오라클에서 티베로 마이그레이션 과정에서 생긴 문제이니 티맥스에 개선 요청을 할 수 있을 것이고
만약 장애가 없어진다면 paging을 위해 생성된 sql 문이 티베로에서 실행 가능한 형태인지
티베로에서 돌아가는 sql 문을 티맥스 측에 요청한 후,
해당 sql 문을 개발팀에 보내 티베로용으로 paging generator를 개선요청하면 될 것 같습니다.
저희도 그 귀하다는 DB2를 사용하는지라
DB2 엔지니어를 통해 생성된 SQL 문을 DB2에 맞게 최적화된 걸 받은 후,
이를 반영하도록 개발팀에 의뢰하여 DB2 Paging generator가 패치되었습니다.
DB2보다 더 귀한 티베로를 쓰시는군요. ^^
이번 기회에 paging 기능에서
현재는 원본 sql만 로그상에 보이는 것을
paging된 sql도 로그상에 보이게 개선되면 좋을 것 같습니다.