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

V

Vladimir.Sakharuk

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.
 
Joined
Aug 31, 2009
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top