spring管理需要关闭链接吗?
我用Spring+hibrnate+struts
我在hibrnate生成的Dao类写了个方法
public Object getUniqueresult(String hql)
{
Object object=null;
try{
object=this.getSession().createQuery(hql).uniqueResult();
}catch (RuntimeException re) {
throw re;
}finally{
this.getSession().close();
}
return object;
}需要关闭连接吗?
我用Spring+hibrnate+struts
我在hibrnate生成的Dao类写了个方法
public Object getUniqueresult(String hql)
{
Object object=null;
try{
object=this.getSession().createQuery(hql).uniqueResult();
}catch (RuntimeException re) {
throw re;
}finally{
this.getSession().close();
}
return object;
}需要关闭连接吗?
可能spring没配上吧