Hi All,
I am developing a web service using Java 1.6 , Hibernate 3.0 , Axis 1.4 and Tomcat Apache 5.5.
My issue is that when i work with the "createCriteria" queries they works fine. But when i use "createSQLQuery" it raise the following exception
"org.hibernate.exception.GenericJDBCException: could not execute query"
and also some times without doing anyting code starts working but some times it gives the same exception.
I also get the following warning
"16:37:50,782 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/Workspace/encode/lib/ehcache-1.1.jar!/ehcache-failsafe.xml"
The code i am using mentioned below
session = queueSessionFactory.openSession();
String sql = "SELECT * FROM queue WHERE status =:status AND assigned_to =:assigned_to";
SQLQuery query = session.createSQLQuery(sql).addEntity("queue", QueueBean.class);
query.setString("assigned_to", serverName);
query.setString("status","queued");
list = query.list();
Any help would be greatly appriciated.
-Thanks
|