-->
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.  [ 1 post ] 
Author Message
 Post subject: DetachedCriteria.ForClass(Clasa) takes very long time
PostPosted: Mon Jul 27, 2009 2:02 pm 
Newbie

Joined: Mon Jul 27, 2009 1:46 pm
Posts: 1
Hi,

I am not very experienced with Hibernate, and I am perplexed by the two usuages listed below:

The first won't return the data for about 10 minutes, while the second returns instantly. Both are using the same object Class JmIm.class, and the underlying table has only 120 rows of data.

Another strange thing is: when I use the first method, the table gets locked and noine can query the table using select * from JmIm table, but can select * from JmIm where jmDesc='someDesc'.

Any input is appreciated.

TIA,

Jeff

1) private List loadLatestJeList(Class claz){
DetachedCriteria crit = DetachedCriteria.forClass(claz);
List l = hibernateDaoHelper.findByCriteria(crit);

2) public JmEntity loadExistingJmEntityByDesc(Class claz,String desc){
DetachedCriteria crit = DetachedCriteria.forClass(claz);
crit.add(Expression.eq("jeDesc",desc));
List l = hibernateDaoHelper.findByCriteria(crit);

////the hibernateDaoHelper used above:
public class HibernateDaoHelper extends HibernateDaoSupport {
public List findByCriteria(DetachedCriteria crit) {
return getHibernateTemplate().findByCriteria(crit);
}


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

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.