0 Replies Latest reply on Feb 23, 2005 11:04 AM by Johan Borchers

    left join result ignored in the read ahead cache with DYNAMI

    Johan Borchers Newbie

      Hello,

      I'm using JBoss 4.0.1 and MySQL 4.1.9.

      I have two simular queries with the same read ahead strategy. But one is normal and the other is dynamic-ql. The first one I can see loads all data and related data from the result set in the read ahead cache. This is nice because that is what I expected from the left outer join.
      But when the dynamic QL is executed only the data from the main EJB is loaded into the read ahead cache. When loading the beans all related parent beans are selected again from the database with a "load relation SQL" statement.
      It seems that with dynamic-ql the CMP engine forgets that the related data is already selected from the database.

      Is this a bug or do I not understand something with dynamic-ql?


      <query>
       <query-method>
       <method-name>findByContractor</method-name>
       <method-params>
       <method-param>nl.vda.contractsys.j2ee.ejb.contractor.ContractorLocal</method-param>
       </method-params>
       </query-method>
       <read-ahead>
       <strategy>on-find</strategy>
       <eager-load-group>lite</eager-load-group>
       <left-join cmr-field="type" eager-load-group="all"></left-join>
       <left-join cmr-field="subject" eager-load-group="all"></left-join>
       <left-join cmr-field="durationPeriod" eager-load-group="all"></left-join>
       <left-join cmr-field="periodOfNoticePeriod" eager-load-group="all"></left-join>
       </read-ahead>
      </query>
      <query>
       <query-method>
       <method-name>ejbSelectGeneric</method-name>
       <method-params>
       <method-param>java.lang.String</method-param>
       <method-param>java.lang.Object[]</method-param>
       </method-params>
       </query-method>
       <dynamic-ql/>
       <read-ahead>
       <strategy>on-find</strategy>
       <eager-load-group>lite</eager-load-group>
       <left-join cmr-field="type" eager-load-group="all"></left-join>
       <left-join cmr-field="subject" eager-load-group="all"></left-join>
       <left-join cmr-field="durationPeriod" eager-load-group="all"></left-join>
       <left-join cmr-field="periodOfNoticePeriod" eager-load-group="all"></left-join>
       </read-ahead>
      </query>
      


      Johan