-->
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: ScrollableResults
PostPosted: Thu Dec 09, 2004 7:57 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
Hibernate version:
2.1.6

Name and version of the database you are using:
SQLServer 2000 + jtds

I've been playing around with the ScrollableResults and I had a few performance issues with it. The problem I have is that sometimes I need to select a very large number of rows out of the database and using find() or a Query often results in out of memory errors or the JVM running very slowly as it has to garbage collect massive amounts ( probably the lvl 1 cache filling up ).

In JDBC all I would do is get the ResultSet and stream the data off it to wherever I want it to go avoiding keeping large amounts in memory. 93k records takes about 3-3.5 seconds to load an instantiate the object manually.

I tried out the Scrollable results and doing the same thing ( using new XXX( ... ) rather than just "from XXX" ) it took roughly 25 seconds. I tweaked the hibernate source so for a scrollable query it would just create a normal PreparedStatement ( BatcherImpl.getPreparedStatement() ) and it only took 6.5 seconds. Much better. Side effect of this change is that a lot of the ScrollableResults scrolling functions will break.

Would it be possible/reasonable to have an overload for scroll() that specifies what sort of scrolling you want, so I could get a forward only/read only scroller that just moves along a ResultSet?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 09, 2004 8:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
There is already scroll(ScrollMode.FORWARD_ONLY) in Hibernate3 - that combined with find/iterate should allow all possible result-set handling techniques, I suppose.


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.