-->
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.  [ 3 posts ] 
Author Message
 Post subject: Taking a lot to translate resultset to objects
PostPosted: Mon Apr 25, 2005 9:46 am 
Beginner
Beginner

Joined: Mon Jan 03, 2005 12:49 pm
Posts: 21
Hi,

I'm executing a query that returns quite a good quantity of rows (almost 1200). The problem is that Hibernate is taking a lot to translate the recordset to object instances. According to this benchmark:

Description of CPU usage for thread main
100.00% - 7752 ms - sun.reflect.DelegatingMethodAccessorImpl.invoke()
100.00% - 7752 ms - sun.reflect.NativeMethodAccessorImpl.invoke()
100.00% - 7752 ms - ar.com.tsoluciones.emergencies.test.InboxManagerServiceTestCase.main()
100.00% - 7752 ms - ar.com.tsoluciones.emergencies.test.InboxManagerServiceTestCase.testFindBy()
100.00% - 7752 ms - ar.com.tsoluciones.telefront.action.InboxManagerService.findBy()
91.60% - 7101 ms - $Proxy0.findCalls()
91.60% - 7101 ms - ar.com.tsoluciones.serviceproxy.proxys.BasicServiceProxy.invoke()
90.83% - 7041 ms - sun.reflect.DelegatingMethodAccessorImpl.invoke()
90.83% - 7041 ms - sun.reflect.NativeMethodAccessorImpl.invoke()
90.83% - 7041 ms - ar.com.tsoluciones.emergencies.service.CallApprovableService.findCalls()
90.70% - 7031 ms - net.sf.hibernate.impl.CriteriaImpl.list()
90.70% - 7031 ms - net.sf.hibernate.impl.SessionImpl.find()
90.70% - 7031 ms - net.sf.hibernate.loader.CriteriaLoader.list()
90.70% - 7031 ms - net.sf.hibernate.loader.Loader.list()
90.70% - 7031 ms - net.sf.hibernate.loader.Loader.doList()
90.70% - 7031 ms - net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections()
90.70% - 7031 ms - net.sf.hibernate.loader.Loader.doQuery()
65.26% - 5059 ms - net.sf.hibernate.loader.Loader.getRowFromResultSet()
12.91% - 1001 ms - net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections()
11.11% - 861 ms - net.sf.hibernate.loader.Loader.getResultSet()
0.90% - 70 ms - org.apache.commons.dbcp.DelegatingResultSet.next()
0.13% - 10 ms - java.net.URLClassLoader$1.run()
0.64% - 50 ms - net.sf.hibernate.impl.SessionImpl.close()
0.13% - 10 ms - ar.com.tsoluciones.serviceproxy.aspects.profiling.BasicProfilingAspect.onFinally()
8.27% - 641 ms - ar.com.tsoluciones.telefront.xmlserializable.CallApprovableXmlSerializable.CallApprovableXmlSerializable()
0.90% - 70 ms - java.text.DateFormat.format()
0.26% - 20 ms - java.text.SimpleDateFormat.SimpleDateFormat()
0.13% - 10 ms - java.net.URLClassLoader$1.run()


getRowFromResultset() is taking a lot more than the execution of the query itself. Is there any config i can tweak, or any design decision I could do to enhace this ??

Thanks in advance !!!

Hibernate version:
2.1.8


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 12:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh ?

The call do execute a query does not mean hibernate nor jdbc has retreived all rows yet - hence getRowFromResultSet will take some time since its that the time done to get each row you see here...

..and your percentage also look like it is the total time used and not the local time used you are measuring which isn't much relevant in this respect - execpt to inform you that yes reading and instantiating the data is what takes time (which in my world makes alot of sense ;)

...and did you check if your code results in multiple selects to also get assocatied collections etc. because of "bad" non-lazy settings ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 3:14 pm 
Beginner
Beginner

Joined: Mon Jan 03, 2005 12:49 pm
Posts: 21
Hi !!

Yes, i'm absolutely sure that hibernate only issues ONE statement. I'm using the profiler and P6Spy to check this.

The percentages are the total time spent on each method taking as measure the total time of the operation. The problem is that the query takes only 1 or 2 seconds in the query analyzer, but executing it through the system takes almost 10 seconds.

Maybe i'm extracting too much many-to-one relationships through outer-joins ? i do that frequently, but i didn't know that it would have that impact on large queries.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.