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: Performance issue while retrieving data from database.
PostPosted: Wed Jun 11, 2008 8:49 pm 
Newbie

Joined: Wed Jun 11, 2008 7:52 pm
Posts: 1
Hi There,
I am using Struts+Spring+Hibernate in the application. I am prepopulating the values in the dropdown boxes by querying the database. It is taking a lot of time to get the values on the screen. Any help to improve the performance is highly appreciated. The below is the code -

Struts Form: I am calling this in resert method.
---------------
public List getCategories() {
return categoryService.getCategories();
}


CategoryDAOHibernate Class:
---------------------------------

public List getCategories(){
List categories=null;
try{
categories=getHibernateTemplate().find("select name from Category");
getSession().close();
} catch (Exception e) {
System.out.println("/nError***************while getting categories. "
+ e);
}
finally{
getSession().close();
}

return list;
}

category.hbm.xml
----------------------
<hibernate-mapping package="com.ambian.hd.hibernate.dto">
<class select-before-update="true" name="Category"
table="CATEGORY">
<cache usage="read-write" />
<id type="java.lang.Long" unsaved-value="null" column="ID">
<generator class="native" />
</id>
<property name="name" type="string" column="NAME"></property>
<property name="desc" type="string" column="DESCRIPTION"></property>
</class>
</hibernate-mapping>


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.