ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Esa Kylli" <esa.ky...@pdb.se>
Subject RE: Problem with db2 driver
Date Thu, 16 Jun 2005 05:38:58 GMT
The two calls I make are exactly the same method (query). It's just that the first time the
method gets called it works just fine, but when the method gets called again I get the error.

The funny thing is that if I switch JDBC driver (in the datasource) to another (AS/400 Toolbox
driver) it works all right. It seems to be the combination of ibatis and the DB2 driver that
causes the problem (I even ran straight JDBC via Spring framework's JDBC support and it worked
well, even with the DB2 driver).

Here are the contents of my sql-map-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
    "http://www.ibatis.com/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

	<sqlMap resource="WEB-INF/ibatis/VesselData.xml"/>
	<sqlMap resource="WEB-INF/ibatis/ArrDepData.xml"/>

</sqlMapConfig>

Here are the contents of ArrDepData.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="ArrDepData">

  <resultMap id="result" class="pog.ad.integration.data.ArrDepData">
	<result property="callsign" column="callsign" columnIndex="1"/>
	<result property="vessel" column="vessel" columnIndex="2"/>
	<result property="estBerthDate" column="estBerthDate" columnIndex="3"/>
	<result property="estBerthTime" column="estBerthTime" columnIndex="4"/>
	<result property="TADate" column="taDate" columnIndex="5"/>
	<result property="TATime" column="taTime" columnIndex="6"/>
	<result property="berthDate" column="berthDate" columnIndex="7"/>
	<result property="berthTime" column="berthTime" columnIndex="8"/>
	<result property="berth" column="berth" columnIndex="9"/>
	<result property="agent" column="agent" columnIndex="10"/>
  </resultMap>

  <select id="getArrDepList" resultMap="result">
  	<![CDATA[
    	SELECT callsign, vessel, estBerthDate, estBerthTime, taDate, taTime, berthDate, berthTime,
berth, agent FROM tbl_ArrDep WHERE type = #type# AND callsign like #callsign# AND estBerthDate
>= #fromDate# AND estBerthDate <= #toDate# ORDER BY estBerthDate, estBerthTime, vessel
    ]]>
  </select>

</sqlMap>

And here is the calling Java code (via Spring framework's SqlMapClientDaoSupport):
	private Collection searchImpl(SearchCriteria criteria) throws DataAccessException {
		if (criteria.getCallsign().trim().length() == 0)
			criteria.setCallsign("%");
		return getSqlMapClientTemplate().queryForList("getArrDepList", criteria);
	}


-----Original Message-----
From: Zarar Siddiqi [mailto:zarar.siddiqi@utoronto.ca] 
Sent: den 15 juni 2005 16:10
To: user-java@ibatis.apache.org
Subject: Re: Problem with db2 driver

Can you also post the calling code and maybe the getArrDepList map.  Do the 
two calls that you're making return the same set of data?

----- Original Message ----- 
From: "Esa Kylli" <esa.kylli@pdb.se>
To: <user-java@ibatis.apache.org>; <lmeadors@apache.org>
Sent: Wednesday, June 15, 2005 9:04 AM
Subject: RE: Problem with db2 driver


> The two calls are exactly the same.
>
> The version I'm using are:
> - Spring Framework 1.2.1. I guess this is packaged with the latest version 
> of ibatis (2.1.0).
> - DB2 is running on iSeries (AS/400) v5.2.
> - My web application is running on WebSphere Application Server 5.0 
> Express on the same server as DB2.
>
> The stack trace I get is the following:
> ¬6/15/05 9:01:45:568 UTC| f72a2b28 InvokeApplica E 
> com.sun.faces.lifecycle.InvokeApplicationPhase  ÄäSearchBean.searchå: 
> javax.faces.el.EvaluationException: 
> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient 
> operation: encountered SQLException
> --- The error occurred in WEB-INF/ibatis/ArrDepData.xml.
> --- The error occurred while applying a parameter map.
> --- Check the getArrDepList-InlineParameterMap.
> --- Check the statement (query failed).
> --- Cause: com.ibm.db2.jdbc.app.DB2DBException: Error Occurred in SQL Call 
> Level Interface|; nested exception is 
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in WEB-INF/ibatis/ArrDepData.xml.
> --- The error occurred while applying a parameter map.
> --- Check the getArrDepList-InlineParameterMap.
> --- Check the statement (query failed).
> --- Cause: com.ibm.db2.jdbc.app.DB2DBException: Error Occurred in SQL Call 
> Level Interface
> ¬6/15/05 9:01:45:584 UTC| f72a2b28 InvokeApplica E 
> com.sun.faces.lifecycle.InvokeApplicationPhase  TRAS0014I: The following 
> exception was logged javax.faces.FacesException: ÄäSearchBean.searchå: 
> javax.faces.el.EvaluationException: 
> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient 
> operation: encountered SQLException
> --- The error occurred in WEB-INF/ibatis/ArrDepData.xml.
> --- The error occurred while applying a parameter map.
> --- Check the getArrDepList-InlineParameterMap.
> --- Check the statement (query failed).
> --- Cause: com.ibm.db2.jdbc.app.DB2DBException: Error Occurred in SQL Call 
> Level Interface|; nested exception is 
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in WEB-INF/ibatis/ArrDepData.xml.
> --- The error occurred while applying a parameter map.
> --- Check the getArrDepList-InlineParameterMap.
> --- Check the statement (query failed).
> --- Cause: com.ibm.db2.jdbc.app.DB2DBException: Error Occurred in SQL Call 
> Level Interface
>      java/lang/Throwable.<init>(Ljava/lang/String;)V+4 (Throwable.java:85)
>      java/lang/Exception.<init>(Ljava/lang/String;)V+1 (Exception.java:33)
>      java/lang/RuntimeException.<init>(Ljava/lang/String;)V+1 
> (RuntimeException.java:38)
> 
> javax/faces/FacesException.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V+0 
> (FacesException.java:71)
> 
> com/sun/faces/application/ActionListenerImpl.processAction(Ljavax/faces/event/ActionEvent;)V+0

> (ActionListenerImpl.java:57)
> 
> javax/faces/component/UICommand.broadcast(Ljavax/faces/event/FacesEvent;)V+0 
> (UICommand.java:297)
>
> Thanks
> Esa
>
>
> -----Original Message-----
> From: Larry Meadors [mailto:larry.meadors@gmail.com]
> Sent: den 15 juni 2005 14:07
> To: user-java@ibatis.apache.org
> Subject: Re: Problem with db2 driver
>
> You have given us the information equivalent to telling a mechanic
> that "My car is broke." here.
>
> Can you give us some more info?
>
> Version, stack trace, what is different between the two calls, ....
>
> Larry
>
>
> On 6/15/05, Esa Kylli <esa.kylli@pdb.se> wrote:
>>
>>
>>
>> Hi,
>>
>>
>>
>> I'm using ibatis (through Spring framework) against a DB2 database, with 
>> the
>> DB2 driver.
>>
>> The first time I run my query it works fine, but the second time I get an
>> exception:
>>
>> com.ibm.db2.jdbc.app.DB2DBException: Error occurred in SQL
>> Call Level Interface
>>
>> ibatis reports the exception with: "The error occurred while applying a
>> parameter map."
>>
>>
>>
>> Has anyone encountered this problem before or does anyone have a clue 
>> what's
>> going on here (and a possible workaround)?
>>
>>
>>
>> Thanks
>>
>>
>>
>>  This e-mail and any attachments may contain confidential and privileged
>> information. If you are not the intended recipient, please notify the 
>> sender
>> immediately by return e-mail, delete this e-mail and destroy any copies. 
>> Any
>> dissemination or use of this information by a person other than the 
>> intended
>> recipient is unauthorized and may be illegal.
>>
>>
>>
>>
>
>
>
> This e-mail and any attachments may contain confidential and
> privileged information. If you are not the intended recipient,
> please notify the sender immediately by return e-mail, delete this
> e-mail and destroy any copies. Any dissemination or use of this
> information by a person other than the intended recipient is
> unauthorized and may be illegal.
> 





This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.

Mime
View raw message