ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: iBatis 2.2.0 and Spring Framework 2.0 Bug
Date Fri, 08 Dec 2006 16:16:11 GMT
We've seen this before:

http://www.mail-archive.com/user-java@ibatis.apache.org/msg06009.html

The bottom line is that you should inject the datasource into the
SQLMapClient, NOT each DAO - this is what is shown in the Spring
documentation, and is the supported method.

Jeff Butler



On 12/8/06, David Hodge <dyhodge@gmail.com> wrote:
>
> This happens when executing a query for list that has a subselect.  We are
> using the SqlMapClientDaoSupport and setting the data source in each DAO
> instead of in the SQLMapClient.  However, by setting the data source in the
> the SQLMapClient, then it works fine.
>
>
> We investigated but we are not sure why this happens.
>
> Here is the stack trace:
>
> java.lang.NullPointerException
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction
> (SqlMapExecutorDelegate.java :780)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(
> SqlMapSessionImpl.java:170)
>     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(
> SqlMapClientImpl.java:149)
>     at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction (
> SqlMapExecutorDelegate.java:880)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
> SqlMapExecutorDelegate.java:621)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
> SqlMapExecutorDelegate.java :588)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(
> SqlMapSessionImpl.java:118)
>     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(
> SqlMapClientImpl.java:96)
>     at
> com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult (
> ResultLoader.java:72)
>     at
> com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(
> ResultLoader.java:59)
>     at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getNestedSelectMappingValue
> (BasicResultMap.java :504)
>     at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(
> BasicResultMap.java:340)
>     at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(
> SqlExecutor.java:375)
>     at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults (
> SqlExecutor.java:295)
>     at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(
> SqlExecutor.java:186)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery
> (GeneralStatement.java :205)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
> (GeneralStatement.java:173)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList
> (GeneralStatement.java :123)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
> SqlMapExecutorDelegate.java:614)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
> SqlMapExecutorDelegate.java:588)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(
> SqlMapSessionImpl.java:118)
>     at
> org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(
> SqlMapClientTemplate.java:263)
>     at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(
> SqlMapClientTemplate.java:188)
>     at
> org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(
> SqlMapClientTemplate.java:214)
>     at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList (
> SqlMapClientTemplate.java:261)
>
> -------
>
> Thanks,
>
> David Y. Hodge
>

Mime
View raw message