5 Replies Latest reply on Aug 4, 2003 11:23 PM by nraghuram

    my CMP Bean in slow

    sundaram


      I have only one CMP bean in my application, it take 10-15 seconds for 150 records, Not only first always same result.

      OS : Redhat 9.0
      Memory : 512 MB


      Only Jboss 321 is running on this machine.

      Any help to improve the perfomance.

      Here is my xml files.

      --------------------
      <![CDATA[This class is part of Middlegen airlines, and it is a CMP EJB accessing the SPDIAL table.]]>

      <ejb-name>Spdial</ejb-name>

      speed.interfaces.SpdialHome
      speed.interfaces.Spdial
      <local-home>speed.interfaces.SpdialLocalHome</local-home>
      speed.interfaces.SpdialLocal

      <ejb-class>speed.ejb.SpdialCMP</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>Spdial</abstract-schema-name>
      <cmp-field >
      <![CDATA[Id of this account.]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the spdial]]>
      <field-name>spdial</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the number]]>
      <field-name>number</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the name]]>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the uuid]]>
      <field-name>uuid</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the created]]>
      <field-name>created</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the creBy]]>
      <field-name>creBy</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the modified]]>
      <field-name>modified</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the modBy]]>
      <field-name>modBy</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>


      <query-method>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT OBJECT(o) FROM Spdial o]]></ejb-ql>


      <![CDATA[SPDIAL is indexed.]]>
      <query-method>
      <method-name>findBySpdial</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.spdial = ?1]]></ejb-ql>


      <![CDATA[NUMBER is not indexed.]]>
      <query-method>
      <method-name>findByNumber</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.number = ?1]]></ejb-ql>


      <![CDATA[NAME is not indexed.]]>
      <query-method>
      <method-name>findByName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.name = ?1]]></ejb-ql>


      <![CDATA[UUID is not indexed.]]>
      <query-method>
      <method-name>findByUuid</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.uuid = ?1]]></ejb-ql>


      <![CDATA[CREATED is not indexed.]]>
      <query-method>
      <method-name>findByCreated</method-name>
      <method-params>
      <method-param>java.sql.Timestamp</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.created = ?1]]></ejb-ql>


      <![CDATA[CRE_BY is not indexed.]]>
      <query-method>
      <method-name>findByCreBy</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.creBy = ?1]]></ejb-ql>


      <![CDATA[MODIFIED is not indexed.]]>
      <query-method>
      <method-name>findByModified</method-name>
      <method-params>
      <method-param>java.sql.Timestamp</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.modified = ?1]]></ejb-ql>


      <![CDATA[MOD_BY is not indexed.]]>
      <query-method>
      <method-name>findByModBy</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Spdial o WHERE o.modBy = ?1]]></ejb-ql>

      <!-- Write a file named ejb-finders-SpdialBean.xml if you want to define extra finders. -->


      ==========================



      <ejb-name>Spdial</ejb-name>
      <table-name>SPDIAL</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>ID</column-name>

      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>

      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>spdial</field-name>
      <column-name>SPDIAL</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>number</field-name>
      <column-name>NUMBER</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>NAME</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>uuid</field-name>
      <column-name>UUID</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>created</field-name>
      <column-name>CREATED</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>creBy</field-name>
      <column-name>CRE_BY</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>modified</field-name>
      <column-name>MODIFIED</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>modBy</field-name>
      <column-name>MOD_BY</column-name>

      </cmp-field>


      <query-method>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>
      </query-method>
      <jboss-ql><![CDATA[SELECT OBJECT(o) FROM Spdial o ORDER BY o.modified desc]]></jboss-ql>



      <unknown-pk>
      <unknown-pk-class>java.lang.Integer</unknown-pk-class>
      <column-name>id</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>
      <auto-increment/>
      </unknown-pk>
      <entity-command name="mysql-get-generated-keys">
      </entity-command>
      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->



      <ejb-name>Rolldata</ejb-name>
      <table-name>ROLLDATA</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>ID</column-name>

      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>

      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>userid</field-name>
      <column-name>USERID</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>roll</field-name>
      <column-name>ROLL</column-name>

      </cmp-field>

      <unknown-pk>
      <unknown-pk-class>java.lang.Integer</unknown-pk-class>
      <column-name>id</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>
      <auto-increment/>
      </unknown-pk>
      <entity-command name="mysql-get-generated-keys">
      </entity-command>
      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->

        • 1. Re: my CMP Bean in slow
          nraghuram

          you should turn on the logging to see the sql queries that are generated. that would give you an idea as to what is causing the problem.

          • 2. Re: my CMP Bean in slow
            sundaram

            Hi,

            I looked at my server.log file, i see lot of JDBC Statement like this.

            2003-08-01 11:41:49,862 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Contact1] Executing SQL: SELECT ID,ACCOUNTNO, COMPANY, CONTACT, LASTNAME, DEPARTMENT, TITLE, SECR, PHONE1, PHONE2, PHONE3, FAX, EXT1, EXT2, EXT3, EXT4, ADDRESS1, ADDRESS2, CITY, STATE, ZIP, COUNTRY, DEAR, SOURCE, KEY1, KEY2, KEY3, KEY4, KEY5, SSTATUS, NOTES, CREATEBY, OWNER, LASTUSER, LASTDATE, LASTTIME, VISIBLETO, RECID FROM CONTACT1 WHERE (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?)

            Just started the jboss server My servlet invokes findAll method .


            The following count keep incrementing, it never comes back.


            $ grep 'org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Contact1' server.log | wc -l
            2715

            $ grep 'org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Contact1' server.l
            og | wc -l
            6643


            Here is my XML Files
            ejb-jar.xml
            ========
            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

            <ejb-jar >

            <![CDATA[No Description.]]>
            <display-name>Generated by XDoclet</display-name>

            <enterprise-beans>

            <!-- Session Beans -->
            <!--
            To add session beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called session-beans.xml that contains
            the markup for those beans.
            -->

            <!-- Entity Beans -->

            <![CDATA[]]>

            <ejb-name>Contact1</ejb-name>

            support.interfaces.Contact1Home
            support.interfaces.Contact1
            <local-home>support.interfaces.Contact1LocalHome</local-home>
            support.interfaces.Contact1Local

            <ejb-class>support.ejb.Contact1CMP</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>Contact1</abstract-schema-name>
            <cmp-field >
            <![CDATA[Returns the id]]>
            <field-name>id</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the accountno]]>
            <field-name>accountno</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the company]]>
            <field-name>company</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the contact]]>
            <field-name>contact</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the lastname]]>
            <field-name>lastname</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the department]]>
            <field-name>department</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the title]]>
            <field-name>title</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the secr]]>
            <field-name>secr</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the phone1]]>
            <field-name>phone1</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the phone2]]>
            <field-name>phone2</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the phone3]]>
            <field-name>phone3</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the fax]]>
            <field-name>fax</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the ext1]]>
            <field-name>ext1</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the ext2]]>
            <field-name>ext2</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the ext3]]>
            <field-name>ext3</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the ext4]]>
            <field-name>ext4</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the address1]]>
            <field-name>address1</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the address2]]>
            <field-name>address2</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the city]]>
            <field-name>city</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the state]]>
            <field-name>state</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the zip]]>
            <field-name>zip</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the country]]>
            <field-name>country</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the dear]]>
            <field-name>dear</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the source]]>
            <field-name>source</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the key1]]>
            <field-name>key1</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the key2]]>
            <field-name>key2</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the key3]]>
            <field-name>key3</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the key4]]>
            <field-name>key4</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the key5]]>
            <field-name>key5</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the sstatus]]>
            <field-name>sstatus</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the notes]]>
            <field-name>notes</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the createby]]>
            <field-name>createby</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the owner]]>
            <field-name>owner</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the lastuser]]>
            <field-name>lastuser</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the lastdate]]>
            <field-name>lastdate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the lasttime]]>
            <field-name>lasttime</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the visibleto]]>
            <field-name>visibleto</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[Returns the recid]]>
            <field-name>recid</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>


            <query-method>
            <method-name>findAll</method-name>
            <method-params>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT OBJECT(o) FROM Contact1 o]]></ejb-ql>


            <![CDATA[ACCOUNTNO is indexed.]]>
            <query-method>
            <method-name>findByAccountno</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.accountno = ?1]]></ejb-ql>


            <![CDATA[COMPANY is not indexed.]]>
            <query-method>
            <method-name>findByCompany</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.company = ?1]]></ejb-ql>


            <![CDATA[CONTACT is not indexed.]]>
            <query-method>
            <method-name>findByContact</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.contact = ?1]]></ejb-ql>


            <![CDATA[LASTNAME is not indexed.]]>
            <query-method>
            <method-name>findByLastname</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.lastname = ?1]]></ejb-ql>


            <![CDATA[DEPARTMENT is not indexed.]]>
            <query-method>
            <method-name>findByDepartment</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.department = ?1]]></ejb-ql>


            <![CDATA[TITLE is not indexed.]]>
            <query-method>
            <method-name>findByTitle</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.title = ?1]]></ejb-ql>


            <![CDATA[SECR is not indexed.]]>
            <query-method>
            <method-name>findBySecr</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.secr = ?1]]></ejb-ql>


            <![CDATA[PHONE1 is not indexed.]]>
            <query-method>
            <method-name>findByPhone1</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.phone1 = ?1]]></ejb-ql>


            <![CDATA[PHONE2 is not indexed.]]>
            <query-method>
            <method-name>findByPhone2</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.phone2 = ?1]]></ejb-ql>


            <![CDATA[PHONE3 is not indexed.]]>
            <query-method>
            <method-name>findByPhone3</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.phone3 = ?1]]></ejb-ql>


            <![CDATA[FAX is not indexed.]]>
            <query-method>
            <method-name>findByFax</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.fax = ?1]]></ejb-ql>


            <![CDATA[EXT1 is not indexed.]]>
            <query-method>
            <method-name>findByExt1</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.ext1 = ?1]]></ejb-ql>


            <![CDATA[EXT2 is not indexed.]]>
            <query-method>
            <method-name>findByExt2</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.ext2 = ?1]]></ejb-ql>


            <![CDATA[EXT3 is not indexed.]]>
            <query-method>
            <method-name>findByExt3</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.ext3 = ?1]]></ejb-ql>


            <![CDATA[EXT4 is not indexed.]]>
            <query-method>
            <method-name>findByExt4</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.ext4 = ?1]]></ejb-ql>


            <![CDATA[ADDRESS1 is not indexed.]]>
            <query-method>
            <method-name>findByAddress1</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.address1 = ?1]]></ejb-ql>


            <![CDATA[ADDRESS2 is not indexed.]]>
            <query-method>
            <method-name>findByAddress2</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.address2 = ?1]]></ejb-ql>


            <![CDATA[CITY is not indexed.]]>
            <query-method>
            <method-name>findByCity</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.city = ?1]]></ejb-ql>


            <![CDATA[STATE is not indexed.]]>
            <query-method>
            <method-name>findByState</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.state = ?1]]></ejb-ql>


            <![CDATA[ZIP is not indexed.]]>
            <query-method>
            <method-name>findByZip</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.zip = ?1]]></ejb-ql>


            <![CDATA[COUNTRY is not indexed.]]>
            <query-method>
            <method-name>findByCountry</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.country = ?1]]></ejb-ql>


            <![CDATA[DEAR is not indexed.]]>
            <query-method>
            <method-name>findByDear</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.dear = ?1]]></ejb-ql>


            <![CDATA[SOURCE is not indexed.]]>
            <query-method>
            <method-name>findBySource</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.source = ?1]]></ejb-ql>


            <![CDATA[KEY1 is not indexed.]]>
            <query-method>
            <method-name>findByKey1</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.key1 = ?1]]></ejb-ql>


            <![CDATA[KEY2 is not indexed.]]>
            <query-method>
            <method-name>findByKey2</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.key2 = ?1]]></ejb-ql>


            <![CDATA[KEY3 is not indexed.]]>
            <query-method>
            <method-name>findByKey3</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.key3 = ?1]]></ejb-ql>


            <![CDATA[KEY4 is not indexed.]]>
            <query-method>
            <method-name>findByKey4</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.key4 = ?1]]></ejb-ql>


            <![CDATA[KEY5 is not indexed.]]>
            <query-method>
            <method-name>findByKey5</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.key5 = ?1]]></ejb-ql>


            <![CDATA[SSTATUS is not indexed.]]>
            <query-method>
            <method-name>findBySstatus</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.sstatus = ?1]]></ejb-ql>


            <![CDATA[CREATEBY is not indexed.]]>
            <query-method>
            <method-name>findByCreateby</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.createby = ?1]]></ejb-ql>


            <![CDATA[OWNER is not indexed.]]>
            <query-method>
            <method-name>findByOwner</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.owner = ?1]]></ejb-ql>


            <![CDATA[LASTUSER is not indexed.]]>
            <query-method>
            <method-name>findByLastuser</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.lastuser = ?1]]></ejb-ql>


            <![CDATA[LASTDATE is not indexed.]]>
            <query-method>
            <method-name>findByLastdate</method-name>
            <method-params>
            <method-param>java.sql.Timestamp</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.lastdate = ?1]]></ejb-ql>


            <![CDATA[LASTTIME is not indexed.]]>
            <query-method>
            <method-name>findByLasttime</method-name>
            <method-params>
            <method-param>java.sql.Timestamp</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.lasttime = ?1]]></ejb-ql>


            <![CDATA[VISIBLETO is not indexed.]]>
            <query-method>
            <method-name>findByVisibleto</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.visibleto = ?1]]></ejb-ql>


            <![CDATA[RECID is not indexed.]]>
            <query-method>
            <method-name>findByRecid</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM Contact1 o WHERE o.recid = ?1]]></ejb-ql>

            <!-- Write a file named ejb-finders-Contact1Bean.xml if you want to define extra finders. -->


            <!--
            To add entity beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called entity-beans.xml that contains
            the markup for those beans.
            -->

            <!-- Message Driven Beans -->
            <!--
            To add message driven beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called message-driven-beans.xml that contains
            the <message-driven></message-driven> markup for those beans.
            -->

            </enterprise-beans>

            <!-- Relationships -->

            <!-- Assembly Descriptor -->
            <assembly-descriptor >
            <!--
            To add additional assembly descriptor info here, add a file to your
            XDoclet merge directory called assembly-descriptor.xml that contains
            the <assembly-descriptor></assembly-descriptor> markup.
            -->

            <!-- finder permissions -->

            <!-- transactions -->
            <container-transaction >

            <ejb-name>Contact1</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>

            <!-- finder transactions -->
            </assembly-descriptor>

            </ejb-jar>



            ===========================
            jbosscmp-jdbc.xml
            -----------------------

            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

            <jbosscmp-jdbc>

            java:/DefaultDS
            <datasource-mapping>mySQL</datasource-mapping>


            <enterprise-beans>

            <!--
            To add beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
            that contains the markup for those beans.
            -->


            <ejb-name>Contact1</ejb-name>
            <table-name>CONTACT1</table-name>

            <cmp-field>
            <field-name>id</field-name>
            <column-name>ID</column-name>

            <jdbc-type>INTEGER</jdbc-type>
            <sql-type>INTEGER</sql-type>

            <auto-increment/>
            </cmp-field>
            <cmp-field>
            <field-name>accountno</field-name>
            <column-name>ACCOUNTNO</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>company</field-name>
            <column-name>COMPANY</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>contact</field-name>
            <column-name>CONTACT</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>lastname</field-name>
            <column-name>LASTNAME</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>department</field-name>
            <column-name>DEPARTMENT</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>title</field-name>
            <column-name>TITLE</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>secr</field-name>
            <column-name>SECR</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>phone1</field-name>
            <column-name>PHONE1</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>phone2</field-name>
            <column-name>PHONE2</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>phone3</field-name>
            <column-name>PHONE3</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>fax</field-name>
            <column-name>FAX</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>ext1</field-name>
            <column-name>EXT1</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>ext2</field-name>
            <column-name>EXT2</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>ext3</field-name>
            <column-name>EXT3</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>ext4</field-name>
            <column-name>EXT4</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>address1</field-name>
            <column-name>ADDRESS1</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>address2</field-name>
            <column-name>ADDRESS2</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>city</field-name>
            <column-name>CITY</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>state</field-name>
            <column-name>STATE</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>zip</field-name>
            <column-name>ZIP</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>country</field-name>
            <column-name>COUNTRY</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>dear</field-name>
            <column-name>DEAR</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>source</field-name>
            <column-name>SOURCE</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>key1</field-name>
            <column-name>KEY1</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>key2</field-name>
            <column-name>KEY2</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>key3</field-name>
            <column-name>KEY3</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>key4</field-name>
            <column-name>KEY4</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>key5</field-name>
            <column-name>KEY5</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>sstatus</field-name>
            <column-name>SSTATUS</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>notes</field-name>
            <column-name>NOTES</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>createby</field-name>
            <column-name>CREATEBY</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>owner</field-name>
            <column-name>OWNER</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>lastuser</field-name>
            <column-name>LASTUSER</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>lastdate</field-name>
            <column-name>LASTDATE</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>lasttime</field-name>
            <column-name>LASTTIME</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>visibleto</field-name>
            <column-name>VISIBLETO</column-name>

            </cmp-field>
            <cmp-field>
            <field-name>recid</field-name>
            <column-name>RECID</column-name>

            </cmp-field>

            <unknown-pk>
            <unknown-pk-class>java.lang.Integer</unknown-pk-class>
            <column-name>id</column-name>
            <jdbc-type>INTEGER</jdbc-type>
            <sql-type>INTEGER</sql-type>
            <auto-increment/>
            </unknown-pk>
            <entity-command name="mysql-get-generated-keys">
            </entity-command>
            <!-- jboss 3.2 features -->
            <!-- optimistic locking does not express the exclusions needed -->


            </enterprise-beans>

            </jbosscmp-jdbc>


            Thanks

            • 3. Re: my CMP Bean in slow
              nraghuram

              can you post the code where you are calling this finder. it could be something related to your transaction settings. my first guess is that the method in which you are iterating over the finder is not transactional, but i may be wrong.
              raghu

              • 4. Re: my CMP Bean in slow
                sundaram

                Hi,

                Plase find the attached source file. it has all xml file, sample CMP EJB, and strtus action file.

                -SR

                • 5. Re: my CMP Bean in slow
                  nraghuram

                  Hi,
                  I havent used Struts so I dont know exactly how it works. But it seems that the Action class would forward the request to some jsp page eventually.
                  In your GetAllAction.java you are getting a collection of EJBObjects. When you try to read individual fields, every method will create a new transaction and discard the cache.
                  If it is only for a view, you can return a collection of value objects. You could write a business method in the entity bean which calls findAll and returns a collection of value objects. I think that would solve your problem.
                  Hope that works.