2 Replies Latest reply on Jan 23, 2003 3:39 PM by bbenton

    commit option A and optimization

    sonwh98

      Hi,

      I set the commit-option to A, but there is no observable difference in performance for B or C. My bean is CMP and all the fields are read only. If the commit-option is A and the bean is read-only, shouldn't the container load the data once into a cache and not access the database for subsequent calls? At the console, I can see that jboss queries the database whenever a findAll() is called. Maybe jboss is intelligent enough to cache these beans and not access the database, but I'm not configuring it right...

      Can someone tell me how to configure it correctly?

      Here's what I did... in jboss.xml


      ...
      ...
      <container-configurations>
      <container-configuration>
      <container-name>Standard CMP 2.x EntityBean</container-name>
      <commit-option>A</commit-option>
      </container-configuration>
      </container-configurations>




      In jbosscmp-jdbc.xml:

      <jbosscmp-jdbc>
      ...

      <ejb-name>PartEJB</ejb-name>
      <read-only>true</read-only>
      <table-name>part</table-name>
      <!-declare cmp-fields are skipped for simplicity -->

      <query-method>
      <method-name>findAll</method-name>
      <method-params/>
      </query-method>
      <read-ahead>
      on-find
      <page-size>1000</page-size>
      </read-ahead>


      ...
      </jbosscmp-jdbc>

      thanks,
      Son To