Hello, i am trying to make a simple Criteria load operation using Hibernate and Spring. But method gives a "unclosed connection" warning after the operation. Here is the code. class is extended from the HibernateDaoSupport. i use simple dbcp configuration for connections.
system actually works, and retrieves a certain amount of messages. i am actually not sure how to use the session here, or if i need to close. but no matter what i did system gave me "unclosed connection " warning.Code:public List getMessages(int max) { try { Criteria crit = this.getSession().createCriteria(EMessage.class); crit.setMaxResults(max); List messages = crit.list(); return messages; } catch (HibernateException e) { e.printStackTrace(); } return null; }
any help?


Reply With Quote
. by the way i use MSSQL with jtds 0.9 driver.