spring with ibatis jdbc throws exception on first attept succeed on second.

Discussion in 'Java' started by Vladimir.Sakharuk@gmail.com, Jul 27, 2006.

  1. Guest

    I got follows exception.
    org.springframework.jdbc.BadSqlGrammarException: SqlMapClient
    operation; bad SQL grammar []; nested exception is
    com.ibatis.common.jdbc.exception.NestedSQLException:
    --- The error occurred in resources/Data.xml.
    --- The error occurred while applying a parameter map.
    --- Check the getIndexes-InlineParameterMap.
    --- Check the statement (query failed).
    --- Cause: java.sql.SQLException: Nxt not found. Specify
    owner.objectname or use sp_help to check whether the object exists
    (sp_help may produce lots of output).

    org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)
    org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:257)
    org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:168)
    org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204)
    org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243)
    ....

    I use jtds for connection.

    The query is valid and works successfully after it fails. It works from
    the beginning but then the table Nxt got recreated(it is periodically
    dropped and recreated). Then query fails and succeed again on a next
    call. The error is not in query - its working all the time, I suspect
    that some of those libraries: spring framework, ibatis, jtds have cache
    something and fails.
    The next request is succeed since something was marks as invalidate.
    This is a query:
    <select id="getIndexes" resultClass="java.util.HashMap">
    select idxName=a.IdxName,am=a.am,status=case when b.fid is null then
    'I' else 'D' end from All a, Nxt b where a.f=#f#
    and a.IdxName*=b.IdxName and a.f*=b.f
    union
    select idxName=IdxName,am, status='N'
    from Nxt where f=#f# and IdxName not in
    (select IdxName from All where f=#f#)
    </select>

    Thanks for helping.
     
    , Jul 27, 2006
    #1
    1. Advertising

  2. bcoulson

    Joined:
    Aug 31, 2009
    Messages:
    1
    Any progress?

    Hello

    I am experiencing very similar behavior to what you described in this thread. I can not get consistent behavior in terms of not working on the first attempt and then working on the second attempt. But I do get this behavior if the database goes down and comes back up again, the connections get messed up and I have to restart my web service and everything is fine.

    Did you make any progress on this - is it a bug with iBatis or the Sybase jconnect driver?

    Thank you for your time
    Brenda
     
    bcoulson, Aug 31, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anonymousgoogledeja

    how can i Know whether atoi function call succeed?

    Anonymousgoogledeja, Aug 22, 2005, in forum: C Programming
    Replies:
    15
    Views:
    1,003
    Jack Klein
    Aug 23, 2005
  2. Replies:
    1
    Views:
    1,553
    RedGrittyBrick
    Sep 21, 2007
  3. Mr. X.
    Replies:
    1
    Views:
    569
    Mr. X.
    Jan 17, 2009
  4. dotnet
    Replies:
    0
    Views:
    356
    dotnet
    Aug 21, 2009
  5. J Krugman

    Tests fail in cpan, succeed manually

    J Krugman, Apr 10, 2004, in forum: Perl Misc
    Replies:
    8
    Views:
    128
    James Willmore
    Apr 26, 2004
Loading...

Share This Page