-->
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: createSQLQuery for queries with large results
PostPosted: Wed May 25, 2011 8:01 pm 
Newbie

Joined: Wed Jul 15, 2009 12:34 pm
Posts: 18
Hello everyone,

I'm running Hibernate 3.3.1.GA and noticed that whenever I use createSQLQuery() to run some SQL queries with large results (by large I mean many thousands of rows), the system gets very slow while the query is being executed. I've tried using ScrollableResults, set the cache mode, flush mode, etc, but it didn't help at all. Funny thing is that if I do an equivalent query in HQL, the query runs very fast. So, you guys might say, "so why don't you use HQL instead!". OK, it's fine to use HQL whenever possible, but what if I can't use HQL? What if I have to run an stored procedure in a legacy database, for example? What can be done to make the SQL query run as fast as the HQL query? Any help appreciated! :)


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.