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: Iteration performance using Hibernate and Struts
PostPosted: Fri Oct 26, 2007 4:02 pm 
Newbie

Joined: Mon Feb 13, 2006 11:12 am
Posts: 4
Hi all, I have a problem with the scalability of an iteration using Hibernate and Struts.

I have a simple JSP page that has an iteration over a big collection, like:

<logic:iterate id="data" name="eventsCampaignForm" property="events" type="com.domain.event.Eventhistory" indexId="ctr" length="<%=length.toString()%>" offset="<%=offset.toString()%>">
......
<td><%= data.getParty().getPartyname() %></td>
......
</logic:iterate>

The "events" property is a java.util.Iterator object on my form bean. I control the paging to display only 10 rows per page. The problem I have is that every time the JSP page is loaded, Hibernate reads the full set of Eventhistory records, one by one:

Hibernate: select person0_.PURN as PURN52_0_, person0_.FIRSTNAME as FIRSTNAME52_0_, person0_.LASTNAME as LASTNAME52_0_, ... from PERSON person0_ where person0_.PURN=?
Hibernate: select party0_.URN as URN51_0_, party0_.PARTYNAME as PARTYNAME51_0_, ... from PARTY party0_ where party0_.URN=?
.....

This is extremely slow. I think, this started to occur since we upgraded hibernate to the latest version.

What can I do to avoid this?

thanks in advance!


Hibernate version:3

Mapping documents:

<class name="Eventhistory" table="EVENTHISTORY">
....
<many-to-one name="party" column="PARTYID" class="com.domain.party.Party" not-found="ignore"/>
....
</class>

<class name="com.domain.party.Party" table="PARTY">
....
<many-to-one name="person" class="com.domain.party.Person" cascade="all" lazy="false" not-found="ignore" column="PURN"/>
.....
</class>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 5:44 am 
Newbie

Joined: Mon Feb 13, 2006 11:12 am
Posts: 4
Any advice on this, please help!


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.