After running successfully for a few weeks at end all of a sudden my
application will throw the following exception:

Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate
operation: could not execute query; uncategorized SQLException for SQL
[select this_.[No.] as No1_0_0_, this_.[Description] as Descript3_0_0_ from
TWL$Item this_ where this_.[No.] like ? and lower(this_.[Description]) like
?]; SQL state [S1000]; error code [8179]; Could not find prepared statement
with handle 2.; nested exception is java.sql.SQLException: Could not find
prepared statement with handle 2.
        at
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:120)
        at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
        at
org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
        at
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
        at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:377)
        at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
        at nz.co.twl.dao.ItemDaoHibernate.searchItems(ItemDaoHibernate.java:36)
        ... 55 more
Caused by: java.sql.SQLException: Could not find prepared statement with
handle 2.
        at
net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
        at
net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
        at
net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
        at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
        at org.hibernate.loader.Loader.doQuery(Loader.java:674)
        at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.doList(Loader.java:2220)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
        at org.hibernate.loader.Loader.list(Loader.java:2099)
        at
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
        at 
nz.co.twl.dao.ItemDaoHibernate$1.doInHibernate(ItemDaoHibernate.java:42)
        at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
        ... 57 more

The set up is hibernate/spring app the driver is JTDS driver 1.2.2 for MSSQL
Server database the database configuration is as follows:

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
        <property name="driverClassName" value="${jdbc.driverClassName}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
        <property name="maxActive" value="100"/>
        <property name="maxWait" value="1000"/>
        <property name="poolPreparedStatements" value="false"/>
        <property name="defaultAutoCommit" value="true"/>
    </bean>

I've searched the internet for this and found nothing. JTDS forums provided
zip. At a loss to why this is happening. It's not a load issue. I'm sure its
something to do with the driver and my configuration for it. But could be a
setting on the database or sthg. Has anyone any ideas on what this could be
or seen it before. Help would be greatly appreciated.
Thanks
David
-- 
View this message in context: 
http://www.nabble.com/Intermittent-java.sql.SQLException%3A-Could-not-find-prepared-statement-with-handle-2.-tp19171379s2369p19171379.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to