-->
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: Object mapping slow for retrieving lists
PostPosted: Mon Apr 16, 2007 11:04 am 
Newbie

Joined: Mon Mar 05, 2007 4:38 am
Posts: 17
Hi,

we are completing a project with hibernate but have stumbled upon a performance problem when retrieving a list of about 100 objects.

The objects are retrieved with a named query in hibernate, but as I see from my logging, hibernate really is the bottleneck as mapping the database results to the objects takes up most of the time.

Retrieving myself a list costs about 9 seconds, and while I perform that SQL query on the database, the data is retrieved in less than 1s. I have defined lazy property fetching for the props I don't need but it appears not to be sufficient :(

Is Hibernate not up to such a task to retrieve lots of objects at one pass? What could I do to improve that performance?

Thank you,
Steven


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:12 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,
First confirm that your session is not bloated with persistent objects. If true, it eats up a lot of space and can slow down the application. Try this,
....
session.flush() ;
session.clear() ;
// My query
.....

-------------------------------------------------------------
Rate the answer if you find it helpful


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.