sitelink1  
sitelink2  
extra_vars5  
extra_vars6  
http://openframework.or.kr/JSPWiki/Wiki.jsp?page=Kwon37xiiBATISDEBUG
원문 : http://kwon37xi.egloos.com/

iBatis 쿼리 작성 XML에서 /* */ 주석 달 때 오류..

iBatis 쿼리 XML을 작성할 때 오라클의 주석문인 /* */을 적으면서 꼭 공백을 넣어야 한다.

 

1. /*주석*/ : 요고 안돼요~2. /* 주석 */ : 요고 돼요~

 

안그러면.. 다음과 같은 오류 발생..

 

SqlMapClient operation; uncategorized SQLException for SQL ; SQL state null; error code [0];--- The error occurred while applying a parameter map.--- Check the query-id-InlineParameterMap.--- Check the results (failed to retrieve results).--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:--- The error occurred while applying a parameter map.--- Check the query-id-InlineParameterMap.--- Check the results (failed to retrieve results).--- Cause: java.lang.NullPointerException

 

iBatis 동적 생성 쿼리(<iterate>)시 이전 컬럼 정보를 가지고 현재 컬럼정보에 강제 매핑하는 현상..

iBatis는 일단 쿼리를 실행하고 나면 그 쿼리 ID에 대해 결과를 저장하는 컬럼들 정보를 캐싱하고 있다가, 다음번 쿼리때 그 컬럼 정보들을 재사용한다.

헌데, 나같은 경우 현재 컬럼 자체를 <iterate>를 이용해 동적으로 생성하기 때문에 동일한 ID의 쿼리라도 실제 쿼리 결과로 돌아오는 컬럼들이 항상 다르다.

이 경우 iBatis가 예전 쿼리의 컬럼 정보에 따라 쿼리 결과를 매핑하려 들기때문에 없는 쿼리에 대한 결과를 요청하는 사태가 발생한다.

<select remapResults="true" ....
어쩌구 저쩌구...

 

위와 같이 remapResults="true" 을 사용하면 컬럼 정보를 쿼리 할 때마다 가져와서 문제가 해결된다.