Cmp & BMP performance
qjafcunuas Feb 25, 2003 9:25 AMHi
I'm using Jboss3.0.4 on Linux, jdk1.4.1_01, with Postgres7.2.1
I've tried to compare performance CMP with BMP.
I've developped 2 entity beans, one in CMP and the second in BMP, accessed to the same table on my DB. The table has got 3 columns. (integer,string,string).
First, i've put commit-option A for standard CMP2, transaction CMP2. The standard BMP is already in commit-option A.
Here is my result to access on the 2 string column of my table with 4100 elements from a JSP :
First call :
standard CMP2 : more than 10 minutes for 200 elements
transaction CMP2 : 18s
standard BMP : 18s
Second call (ejb presume in memory)
standard CMP2 : 3s for 200 elements
transaction CMP2 : 5s
standard BMP : 3s
I've hoped that CMP will be more performant than BMP.
So probably i make a mistake in my developpement or configuration.
Here is my ejb-jar description for those EntityBeans :
<ejb-name>TvnCountryCMPName</ejb-name>
server.base.ejb.CountryHome
server.base.ejb.CountryRemote
<ejb-class>server.base.ejb.CountryCMPBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>country</abstract-schema-name>
<primkey-field>id</primkey-field>
<cmp-field>
<field-name>label</field-name>
</cmp-field>
<cmp-field>
<field-name>code</field-name>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<resource-ref>
<res-ref-name>jdbc/TVNDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-name>TvnCountryBMPName</ejb-name>
server.base.ejb.CountryHome
server.base.ejb.CountryRemote
<ejb-class>server.base.ejb.CountryBMPBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False
<resource-ref>
<res-ref-name>jdbc/TVNDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<container-transaction>
<ejb-name>TvnCountryCMPName</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<ejb-name>TvnCountryBMPName</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
Can somebody help me ?
tia
Bruno