Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1989

eager-load-group for CMR doesn't work

    XMLWordPrintable

Details

    Description

      JBoss 3.2.6/3.2.7, default setting in standardjbosscmp-jdbc.xml, commit option A used, transaction 'required'
      I observed strange selects for two applications. There is relation A -> many B (unidirectional), loid is primary key

      a.getBs() gives select:
      SELECT LOID FROM B WHERE (A_FK=?)

      and now every entity B is accessed by fields, it gives:
      SELECT LOID, field1 FROM B WHERE (LOID=?) OR (LOID=?) OR (LOID=?) OR (LOID=?) OR ...

      SELECT LOID, field2 FROM B WHERE (LOID=?) OR (LOID=?) OR (LOID=?) OR (LOID=?) OR ...
      (it is in 3.2.6, on 3.2.7 I have the same but without loid in select)

      and so on for every field. So obviously read-ahead works and eager-load-group doesn't (default * eager group)

      Even to be sure I tried to set read-ahead for relation:
      <ejb-relation>
      <ejb-relation-name>A2Bs</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>A2Bs:A</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>loid</field-name>
      <column-name>A_FK</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>
      </key-field>
      </key-fields>

      <read-ahead>
      on-load
      <eager-load-group>*</eager-load-group>
      </read-ahead>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>A2Bs:Bs</ejb-relationship-role-name>
      <fk-constraint>true</fk-constraint>
      <key-fields/>

      </ejb-relationship-role>
      </ejb-relation>

      It didn't change the behaviour.
      (by the way loading of main entity A is ok, eager load works properly in this case)

      In project we have 100 beans and half of it is in CMR relations - and such selects really kills performance.
      The forum topic is: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3883621.

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            tbech tbech (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: