This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes Hibernate performance.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate performance.." Watch "Hibernate performance.." New topic
Author

Hibernate performance..

Alejandro Ross
Greenhorn

Joined: Jun 13, 2006
Posts: 9
Hi everyone.. I have a huge ORDERS table to work with and each customer has a set of ORDERS within the orders table. There are over 2 million records in the ORDERS table. I tried to run the following in Hibernate (Java) but got a java.lang.OutOfMemoryError: Java heap space error. HELP!!
What is the best move I can make to fix this problem?

"select sum(orderz.result03),sum(orderz.result05),sum(orderz.result07),sum(orderz.result08),sum(orderz.result09),sum(orderz.result26)," +
// "sum(orderz.result02),sum(orderz.result04),sum(orderz.result06),sum(orderz.result13),sum(orderz.result16),sum(orderz.result18)," +
// "sum(orderz.result19),sum(orderz.result25)," +
// "sum(orderz.result15),sum(orderz.result17),sum(orderz.result00),sum(orderz.result01)" +
//" from DialingListEntry as orderz where orderz.CUSTOMER_ID = :custId")
// .setInteger("custId", custId);

Anyone have any suggestions??? Help is much appreciated... In either DB work or hibernate.. Thanks
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Where is all the code, and why are all the lines commented out except the first line?

Why not just create a SQLQuery object and run that instead of with Query object. This way it won't fill up your 1st level cache. Or set the CacheMode to None, and it won't cache the objects created for the query.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate performance..