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! :)
|