one possibility of tuning CMP permormance is the definition of load groups read-ahead strategies. Example from the docs (it's from jboss 3.2 so I don't know if it is exactly the same in jboss 4)
Define load group for the entity bean:
<load-groups> <load-group> <load-group-name>basic</load-group-name> <field-name>name</field-name> <field-name>nickName</field-name> <field-name>badness</field-name> </load-group> </load-groups>
Specify read-ahead strategy for the query
<query> ... <read-ahead> <strategy>on-find</strategy> <page-size>4</page-size> <eager-load-group>basic</eager-load-group> </read-ahead> </query>
Take a look at the docs on how to do this with jboss 4.
thanks for your response .
I had tried with Read-ahead but did not give any change and later tired with lazy-loadgroup....
I was able to reduce the total number of query which was reapeating more than 200 times to 50times by
using the Loadgroup and lazy load group tag in jbosjdbc-cmp.xml file..
I have a entity bean called content:
before this change the container was firing the selcet query as:
SELECT NAME FROM CONTENT WHERE (CONTENT_ID=?)
SELECT REFERENCE_NAME FROM CONTENT WHERE (CONTENT_ID=?)
SELECT CONTENTTYPE_ID FROM CONTENT WHERE (CONTENT_ID=?)
SELECT RESOURCE_ID FROM CONTENT WHERE (CONTENT_ID=?)
total 200 times the query was fired....
but now the query has become..
SELECT NAME, REFERENCE_NAME, CONTENTTYPE_ID, RESOURCE_ID FROM CONTENT WHERE (CONTENT_ID=?)
but just 50 times....
Now I want to c if the container is trying to fire the query for the same CONTENT_ID or different..
Is it possible to get for which value is it firing the query everytime.
If its the same content ID is there a way I can reduce thenumber of queries still...
Any thoughts plz..
U can put this on the query tag on jbosscmp-jdbc.xml file,
<left-join cmr-field="expendeduria" eager-load-group="basic"/>
I've read but i doesn't work with 323. Even what you have tried it doesn't work with my mysql....
What's the transaction attribute for the entity bean and the session bean accessing this entity bean?
Reading one field after the other may have to do with it.
We use REQUIRED per default for all and REQUIRES NEW for some special cases.