Hi all !
We have, from time to time, a strange sql error in a production environnement : Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 1 In this code :
Code:
public Book findBook(String code) throws PWRBusinessException {
try {
return (Book) session.getNamedQuery("findBookByCode").setString(
"code", code).uniqueResult();
} catch (HibernateException e) {
throw new PWRBusinessException(e);
}
}
The problem occurs even with another setString() like code !
Any idea ?
Thank you !
Yazid
--------------------------------
Hibernate version:
Hibernate 2.1.6
Full stack trace of any exception that occurs:
Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(Ljava.lang.String;Ljava.lang.String;I)V(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(ILjava.lang.Object;)V(DatabaseError.java:162)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(IZ)V(Optimized Method)
at oracle.jdbc.driver.OraclePreparedStatement.clean_temp_clobs()V(Optimized Method)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I(Optimized Method)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava.sql.ResultSet;(Optimized Method)
at weblogic.jdbc.wrapper.PreparedStatement.executeQuery()Ljava.sql.ResultSet;(Optimized Method)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(Ljava.sql.PreparedStatement;)Ljava.sql.ResultSet;(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Ljava.sql.PreparedStatement;Lnet.sf.hibernate.engine.RowSelection;Lnet.sf.hibernate.engine.SessionImplementor;)Ljava.sql.ResultSet;(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;Ljava.lang.Object;Ljava.io.Serializable;[Ljava.io.Serializable;Z)Ljava.util.List;(Optimized Method)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;Ljava.lang.Object;Ljava.io.Serializable;[Ljava.io.Serializable;Z)Ljava.util.List;(Optimized Method)
at net.sf.hibernate.loader.Loader.doList(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;)Ljava.util.List;(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;Ljava.util.Set;[Lnet.sf.hibernate.type.Type;)Ljava.util.List;(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(Lnet.sf.hibernate.engine.SessionImplementor;Lnet.sf.hibernate.engine.QueryParameters;)Ljava.util.List;(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(Ljava.lang.String;Lnet.sf.hibernate.engine.QueryParameters;)Ljava.util.List;(SessionImpl.java:1544)
at net.sf.hibernate.impl.QueryImpl.list()Ljava.util.List;(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult()Ljava.lang.Object;(AbstractQueryImpl.java:550)
at com.bnpparibas.eqd.power.model.booking.impl.HibernateBookingService.findBook(Ljava.lang.String;)Lcom.bnpparibas.eqd.power.model.booking.Book;(HibernateBookingService.java:40)
Name and version of the database you are using:
Oracle 8.1