• Post Reply Bookmark Topic Watch Topic
  • New Topic

query question

 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • 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!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35716
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastiaan,
Why can't you use JDBC?
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!