and would really appreciate some help here. I have amended my class file as so:
import org.jboss.hibernate.session.HibernateContext;
import org.jboss.tm.TransactionLocal;
import net.sf.hibernate.*;
...........
Session session = HibernateContext.getSession("java:/HibernateFactory");
try {
//Util = new HibernateUtil();
//session = Util.currentSession();
transaction = session.beginTransaction();
//Get User details
Query query = session.createQuery("from test.User as user where user.UserName=:username and user.UserPassword=:password")
.setString("username",username)
.setString("password",password);
user = (User) query.uniqueResult();
transaction.commit();
//Util.closeSession();
} catch (HibernateException e) {
throw new RuntimeException("Exception in Hibernate:: " + e.getMessage(), e);
}
When I call the method no data is being returned and I get the following output in the logs:
2004-10-23 01:09:52,014 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: HibernateFactory
2004-10-23 01:09:52,015 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=d1e22501ffc2fc8300ffc2fc87990000
2004-10-23 01:09:52,015 DEBUG [net.sf.hibernate.impl.SessionImpl] opened session
2004-10-23 01:09:52,134 INFO [org.apache.jk.server.JkCoyoteHandler] Response already commited
2004-10-23 01:09:52,151 INFO [org.apache.jk.server.JkCoyoteHandler] Response already commited
2004-10-23 01:09:52,187 INFO [org.apache.jk.server.JkCoyoteHandler] Response already commited
many thanks
Andrew
|