HibernateDaoSupport 获取session 问题
ssh 框架 反复运行这个DAO后 显示 Cannot get a connection, pool error Timeout waiting for idle object
public class DeviceAlarmDAOImpl extends HibernateDaoSupport implements DeviceAlarmDAO { private HibernateTemplate ht; public void init() { ht = getHibernateTemplate(); }。。。。。。。Session session = this.getSession();String hql = "select count(alarmID) from DeviceAlarmInfo";int total = 0; try { Query query = session.createQuery(hql); total = ((Number) query.uniqueResult()).intValue(); return Integer.valueOf(total); } catch (Exception e) { e.printStackTrace(); return 0; } finally { session.close(); }