I am getting the following SQLException when using Hibertnate on JBoss. Any ideas of what might be happening?
2005-11-22 16:43:31,171 [nitor] WARN net.sf.hibernate.util.JDBCExceptionReporter : SQL Error: 2812, SQLState: 37000
2005-11-22 16:43:31,171 [nitor] ERROR net.sf.hibernate.util.JDBCExceptionReporter : Could not find stored procedure '#jtds000012'.
2005-11-22 16:43:31,171 [nitor] WARN net.sf.hibernate.util.JDBCExceptionReporter : SQL Error: 2812, SQLState: 37000
2005-11-22 16:43:31,171 [nitor] ERROR net.sf.hibernate.util.JDBCExceptionReporter : Could not find stored procedure '#jtds000012'.
2005-11-22 16:43:31,171 [nitor] ERROR net.sf.hibernate.util.JDBCExceptionReporter : Could not execute query
java.sql.SQLException: Could not find stored procedure '#jtds000012'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:367)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2606)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2048)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:574)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:321)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:314)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:958)
at net.sf.hibernate.loader.Loader.list(Loader.java:949)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:542)
at com.mwvis.dm.dao.DataManagerDAOHelper.findUniqueResultQuery(DataManagerDAOHelper.java:287)
at com.mwvis.dm.dao.EpcClDAO.get(EpcClDAO.java:220)
at com.mwvis.dm.ejb.session.DataManagerServiceBean.updateOos(DataManagerServiceBean.java:3769)
at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy104.updateOos(Unknown Source)
at com.mwvis.dm.mbeans.BatchUpdateManager.run(BatchUpdateManager.java:197)
at java.lang.Thread.run(Thread.java:534)
2005-11-22 16:43:31,187 [nitor] ERROR com.mwvis.dm.dao.DataManagerDAOHelper : Hibernate exception thrown
net.sf.hibernate.JDBCException: Could not execute query
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1546)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:542)
at com.mwvis.dm.dao.DataManagerDAOHelper.findUniqueResultQuery(DataManagerDAOHelper.java:287)
at com.mwvis.dm.dao.EpcClDAO.get(EpcClDAO.java:220)
at com.mwvis.dm.ejb.session.DataManagerServiceBean.updateOos(DataManagerServiceBean.java:3769)
at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy104.updateOos(Unknown Source)
at com.mwvis.dm.mbeans.BatchUpdateManager.run(BatchUpdateManager.java:197)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: Could not find stored procedure '#jtds000012'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:367)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2606)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2048)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:574)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:321)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:314)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:958)
at net.sf.hibernate.loader.Loader.list(Loader.java:949)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
... 24 more
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You seem to be using an old version of jTDS. Please upgrade to the latest release, 1.2.
The error you are seeing is caused by a missing temporary stored procedure that jTDS uses to prepare statements in one of the 4 prepare modes. The default prepare mode changed a few releases back and it's now sp_prepare based. The temporary procedures mode is still supported and this synchronization issue should be fixed also.
Alin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am getting the following SQLException when using Hibertnate on JBoss. Any ideas of what might be happening?
2005-11-22 16:43:31,171 [nitor] WARN net.sf.hibernate.util.JDBCExceptionReporter : SQL Error: 2812, SQLState: 37000
2005-11-22 16:43:31,171 [nitor] ERROR net.sf.hibernate.util.JDBCExceptionReporter : Could not find stored procedure '#jtds000012'.
2005-11-22 16:43:31,171 [nitor] WARN net.sf.hibernate.util.JDBCExceptionReporter : SQL Error: 2812, SQLState: 37000
2005-11-22 16:43:31,171 [nitor] ERROR net.sf.hibernate.util.JDBCExceptionReporter : Could not find stored procedure '#jtds000012'.
2005-11-22 16:43:31,171 [nitor] ERROR net.sf.hibernate.util.JDBCExceptionReporter : Could not execute query
java.sql.SQLException: Could not find stored procedure '#jtds000012'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:367)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2606)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2048)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:574)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:321)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:314)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:958)
at net.sf.hibernate.loader.Loader.list(Loader.java:949)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:542)
at com.mwvis.dm.dao.DataManagerDAOHelper.findUniqueResultQuery(DataManagerDAOHelper.java:287)
at com.mwvis.dm.dao.EpcClDAO.get(EpcClDAO.java:220)
at com.mwvis.dm.ejb.session.DataManagerServiceBean.updateOos(DataManagerServiceBean.java:3769)
at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy104.updateOos(Unknown Source)
at com.mwvis.dm.mbeans.BatchUpdateManager.run(BatchUpdateManager.java:197)
at java.lang.Thread.run(Thread.java:534)
2005-11-22 16:43:31,187 [nitor] ERROR com.mwvis.dm.dao.DataManagerDAOHelper : Hibernate exception thrown
net.sf.hibernate.JDBCException: Could not execute query
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1546)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:542)
at com.mwvis.dm.dao.DataManagerDAOHelper.findUniqueResultQuery(DataManagerDAOHelper.java:287)
at com.mwvis.dm.dao.EpcClDAO.get(EpcClDAO.java:220)
at com.mwvis.dm.ejb.session.DataManagerServiceBean.updateOos(DataManagerServiceBean.java:3769)
at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy104.updateOos(Unknown Source)
at com.mwvis.dm.mbeans.BatchUpdateManager.run(BatchUpdateManager.java:197)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: Could not find stored procedure '#jtds000012'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:367)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2606)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2048)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:574)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:321)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:314)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:958)
at net.sf.hibernate.loader.Loader.list(Loader.java:949)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
... 24 more
You seem to be using an old version of jTDS. Please upgrade to the latest release, 1.2.
The error you are seeing is caused by a missing temporary stored procedure that jTDS uses to prepare statements in one of the 4 prepare modes. The default prepare mode changed a few releases back and it's now sp_prepare based. The temporary procedures mode is still supported and this synchronization issue should be fixed also.
Alin.