1 Reply Latest reply on Feb 25, 2003 12:05 PM by Darryl A. J. Staflund

    Cmp & BMP performance

    Lamouret Newbie

      Hi

      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

        • 1. Re: Cmp & BMP performance
          Darryl A. J. Staflund Newbie

          Hi there,

          I suffered terrible CMP performance using PostgreSQL 7.2.x as well and found that the only fix was to upgrade PostgreSQL to 7.3.x. In our case anyway, PostgreSQL 7.2.x seemed to auto-commit each individual query even though they supposed to be treated as one general transaction (I might be reading the logs incorrectly, though.) Once we upgraded to 7.3.x, CMP became very performance (in our case, about 1400 queries were processed in about 5 seconds.)

          Hope this helps.
          Darryl