I tried using Hibernate to pull a large number of objects (~70,000) from two tables that are joined together. The HQL does a join and generates just a single SQL statement. I've captured the SQL query and have verified that it runs pretty fast. The problem is that Hibernate takes about 6 minutes to create all the objects I need after the query has been run.
I wrote some JDBC code to pull the same 70,000 records, using the same query, then create objects out of the resultset. The total time in this case is about 6-8 seconds.
I can post the code if needed, but is this poor of performance typical with that number of records? Any ideas what Hibernate is doing that takes so long? Any general ideas on how to optimize the post-query object creation that Hibernate does?
BTW: Pagination is not an option as I am trying to load data to prime a browser-side cache built on Google Gears.