-
1. Re: Ways to tune Jboss CMP
smeier Jun 16, 2005 3:59 AM (in response to raviupasi)Hi Ravi,
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.
Regards,
Stefan -
2. Re: Ways to tune Jboss CMP
raviupasi Jun 17, 2005 12:46 AM (in response to raviupasi)Hi Stefan,
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..
for example:
I have a entity bean called content:
<ejb-name>Content</ejb-name>
.....
<load-group>
ContentTable
<load-group-name>ContentLG</load-group-name>
<field-name>name</field-name>
<field-name>referenceName</field-name>
<field-name>categoryId</field-name>
<field-name>contentTypeId</field-name>
<field-name>resourceId</field-name>
</load-group>
</load-groups>
<lazy-load-groups>
<load-group-name>ContentLG</load-group-name>
</lazy-load-groups>
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..
regards,
Ravi -
3. Re: Ways to tune Jboss CMP
jblas Jan 31, 2006 10:31 AM (in response to raviupasi)Hi mate,
U can put this on the query tag on jbosscmp-jdbc.xml file,
<read-ahead>
on-find
<page-size>200</page-size>
<eager-load-group>basic</eager-load-group>
<left-join cmr-field="expendeduria" eager-load-group="basic"/>
</read-ahead>
as well...
I've read but i doesn't work with 323. Even what you have tried it doesn't work with my mysql.... -
4. Re: Ways to tune Jboss CMP
lafr Jan 31, 2006 5:14 PM (in response to raviupasi)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.