Hello, I'm just trying to retrieve a list of objects from DB, using this code:
public boolean isRegistered(String classs, String id) {
Criteria criteria = this.getSession().createCriteria(MyObject.class);
criteria.add(Restrictions.eq("classs", classs));
criteria.add(Restrictions.eq("id", id));
criteria.setMaxResults(1);
List<MyObject> list = criteria.list();
return list;
}
It returns me "forgot to call close() on your session", and after a certain calls to this method, tomcat freezes. I tried this.getSession().close(), with no avail. In fact calling that gives me warnings of finalizing a closed session.
What would I do in this situation,
Thanks in advance,
AR
|