1 plus N select problem ------------------------ Key: IBATIS-426 URL: https://issues.apache.org/jira/browse/IBATIS-426 Project: iBatis for Java Issue Type: Bug Components: SQL Maps Affects Versions: 2.3.0, 2.2.0 Reporter: yanlan
sql-mapping-***.xml content:[ <resultMap id="policy-result" class="com.paic.pafademo.appdemo.biz.bo.Policy"> <result property="policyNo" column="POLICY_NO"/> <result property="applicationDate" column="APPLICATION_DATE"/> <result property="policyPlans" column="POLICY_NO" select="searchPolicyPlanByPolicyNo"/> </resultMap> ] use select in result map,then the exception is thrown . then i found in sqlmapclientimpl.opensession() method. SqlMapSessionImpl sqlMapSession = getLocalSqlMapSession(); in 2.1.7 SqlMapSessionImpl sqlMapSession = new SqlMapSessionImpl(this); in 2.2.0 & 2.3.0 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(Lcom.ibatis.sqlmap.engine.scope.SessionScope;)V(SqlMapExecutorDelegate.java:780) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction()V(SqlMapSessionImpl.java:170) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction()V(SqlMapClientImpl.java:149) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(Lcom.ibatis.sqlmap.engine.scope.SessionScope;Z)V(SqlMapExecutorDelegate.java:880) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(Lcom.ibatis.sqlmap.engine.scope.SessionScope;Ljava.lang.String;Ljava.lang.Object;II)Ljava.util.List;(SqlMapExecutorDelegate.java:621) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(Lcom.ibatis.sqlmap.engine.scope.SessionScope;Ljava.lang.String;Ljava.lang.Object;)Ljava.util.List;(SqlMapExecutorDelegate.java:588) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(Ljava.lang.String;Ljava.lang.Object;)Ljava.util.List;(SqlMapSessionImpl.java:118) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForist(Ljava.lang.String;Ljava.lang.Object;)Ljava.util.List;(SqlMapClientImpl.java:96) at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult(Lcom.ibatis.sqlmap.engine.impl.ExtendedSqlMapClient;Ljava.lang.String;Ljava.lang.Object;Ljava.lang.Class;)Ljava.lang.Object;(ResultLoader.java:72) at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(Lcom.ibatis.sqlmap.engine.impl.ExtendedSqlMapClient;Ljava.lang.String;Ljava.lang.Object;Ljava.lang.Class;)Ljava.lang.Object;(ResultLoader.java:59) at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getNestedSelectMappingValue(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Ljava.sql.ResultSet;Lcom.ibatis.sqlmap.engine.mapping.result.BasicResultMapping;Ljava.lang.Class;)Ljava.lang.Object;(BasicResultMap.java:504) at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Ljava.sql.ResultSet;)[Ljava.lang.Object;(BasicResultMap.java:340) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Ljava.sql.ResultSet;IILcom.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback;)V(SqlExecutor.java:375) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(Ljava.sql.PreparedStatement;Lcom.ibatis.sqlmap.engine.scope.RequestScope;IILcom.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback;)Ljava.sql.ResultSet;(SqlExecutor.java:295) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Ljava.sql.Connection;Ljava.lang.String;[Ljava.lang.Object;IILcom.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback;)V(SqlExecutor.java:186) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Ljava.sql.Connection;Ljava.lang.String;[Ljava.lang.Object;IILcom.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback;)V(GeneralStatement.java:205) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Ljava.sql.Connection;Ljava.lang.Object;Ljava.lang.Object;Lcom.ibatis.sqlmap.client.event.RowHandler;II)V(GeneralStatement.java:173) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(Lcom.ibatis.sqlmap.engine.scope.RequestScope;Lcom.ibatis.sqlmap.engine.transaction.Transaction;Ljava.lang.Object;II)Ljava.util.List;(GeneralStatement.java:123) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(Lcom.ibatis.sqlmap.engine.scope.SessionScope;Ljava.lang.String;Ljava.lang.Object;II)Ljava.util.List;(SqlMapExecutorDelegate.java:614) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(Lcom.ibatis.sqlmap.engine.scope.SessionScope;Ljava.lang.String;Ljava.lang.Object;)Ljava.util.List;(SqlMapExecutorDelegate.java:588) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(Ljava.lang.String;Ljava.lang.Object;)Ljava.util.List;(SqlMapSessionImpl.java:118) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.