高兴散分,妈的,c3pO连接池,耽误了我两天时间,希望大家以后注意.
Session s = HibernateSessionFactory.currentSession();
String hql=null;
Iterator it=null;
//第一段
hql="From BmStbi where sbeno='02200607040001'";
it = s.createQuery(hql).list().iterator();
BmStbi bs = (BmStbi)it.next();
out.print(bs.getSbeno());
out.print(bs.getSbeno());
//第二段
hql="From BmDictionary where code='0313012'";
it = s.createQuery(hql).list().iterator();
BmDictionary bd=(BmDictionary)it.next();
out.print(bd.getCode());
out.print(bd.getName());
HibernateSessionFactory.closeSession();
问题:
两段同时执行就报异常:
org.apache.jasper.JasperException: could not execute query
注释掉任何一段的话,执行正常,我实在不知道错在哪里了.