-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: closing sessions (using criteria)
PostPosted: Fri Jun 29, 2007 12:21 pm 
Newbie

Joined: Fri Jun 29, 2007 11:09 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 12:15 pm 
Newbie

Joined: Fri Jun 29, 2007 11:09 am
Posts: 2
can someone please assist me, or point me in the right direction by giving me a link.

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.