Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Hibernate performance..  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17344
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I love a good mentalist. And so does this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!