ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giovanni Cuccu" <giovanni.cu...@gmail.com>
Subject Re: IBatis Random ORA-01722: invalid number error
Date Thu, 11 Sep 2008 06:54:30 GMT
    if you have the iBatis logs and all seems ok I suggest you to
enable the oracle trace with the following instructions
these one should be issued after you get the connection
alter session set timed_statistics=true;
alter session set max_dump_file_size=unlimited;

these one should be issued before executing the sql
alter session set events '10046 trace name context forever, level 12' ;

these one should be issued after executing the sql
alter session set events '10046 trace name context off';

Oracle should produce a trc file in the $ORACLE_HOME/<some_path>/udump
directory of the server
you can analyze the file by yourself (it's not veary understandable at
firt sigth) or with tkprof.
in the trc files you can see the value of the bind variable, the type
and the error. with these information it should be easy to diagnose
the issue.

On Thu, Sep 11, 2008 at 3:05 AM, Givler, Eric <egivler@state.pa.us> wrote:
> We have a production application that is periodically returning an error from a query.
 In fact, the user refreshes the page and the same query runs fine.  The query takes a hashmap
as a parameter and returns an ArrayList of hashmaps.  When we examine the logs, in which we
can see the query and the jdbc parameters and resultsets, the parameters and query are identical
between calls, except the first call fails.
> The mapping query is like this:
> <select id="getDatabaseRows" paramClass="map" resultClass="java.util.HashMap">
>   select c.descrip
>           , sum(v.item_count) as count
>     from table1 v
>         , table2 c
>    where v.id = #id#
>      and v.codeid=c.codeid
>   group by c.descrip
>  </select>
> The call is like:
>  HashMap params = new HashMap();
>  params.add( "id", new Long("123");
>  List result = (ArrayList) sqlMap.queryForList("Namespace.getDatabaseRows", params );
> If we cut&paste the query that is failing into other tools, like SQL*Plus, or TOAD
for Oracle, it runs fine.  In fact, if we step it, it runs fine.  Today, out of the 70 times
it executed, it failed 4 times.  The user refreshed the page each time and the query ran without
> Is there anything we can do to track down what is happening here?  It seems like the
parameter must be somehow read/treated as a character on the first call which would make it
fail, but we see in the log that it's a java.lang.Long.  If it helps, we are in a Java 1.4.2
environment under ORacle Application Server, and the iBATIS version is
 The backend database is Oracle 10G Release 2 I think.
> Thanks for any help,
> Eric

"You don't know the power of dark side" - Darth Vader

View raw message