• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

query question

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I have 3 tables that look something like this:
pricelistrelease:
*rowid
*releasedate
*name
product
*rowid
*name
*lots other stuff
referenceproductprice
*rowid
*pricelistrelease
*product
*price
Now I would like to get all of the products that belong to a certain pricelistrelease, and have their prices.. So I do a findAllOnPricelistrelease finder query on the referenceproductprice home interface.
The query looks like this:
SELECT OBJECT(rpp)
FROM ReferenceProductPrice rpp
WHERE rpp.pricelistRelease.row_id = ?1
This will get all of the referenceproductprices I need. In the code I create an object that contains all of the referenceproductprice data, and all of the product data. This means that for eacht referenceproductprice, my app server will do another query to get all of the productinformation needed to fille the object. This results in a gigantic number of queries (product exists of some subbeans), and I usually have to wait for about 4 mins before I get my data (runs on a Xeon 2GHz, 1gig ram).
In normal SQL I would write a simple query that contains some INNER JOINS.
Is there a way to enhance the performance a lot? (own inner join query takes about half a second)
thanks!
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sebastiaan,
Why can't you use JDBC?
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We would like to use CMP, and since our problem is a very common one, I would suspect CMP to handle it correctly...

If CMP can't handle it any better than running a gazillion queries to get some beans, we'll have to implement our own database connection framework.. which is more work ofcourse..
[ May 13, 2004: Message edited by: Sebastiaan Kortleven ]
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic