2 Replies Latest reply on Jan 31, 2003 1:33 PM by chadlavy

    Need to optimize

    chadlavy

      Hi,

      When using entity beans to fetch a Collection of data objects, I am getting the following error from DB2:

      The statement is too long or too complex

      The DB2 documentation says that you should increase the DB2 heap size to remedy this. We jacked the heap up quite a bit and still get the error. Alternatively, the documentation says that you should break up your query so that it is not as complex. I have noticed that JBoss seems to create huge SQL statements with a lot of AND's when hitting the database. This occurs despite the fact that the EJBQL describing the statement is pretty simple.

      Has anyone else run into this?

      Is there a way to get JBoss to simplify the queries it issues?

      Thanks In Advance,
      Chad Lavy

        • 1. Re: Need to optimize

          <jbosscmp-jdbc>


          <page-size>100</page-size>


          To limit the read-ahead, the default is 1000.

          Regards,
          Adrian

          • 2. Re: Need to optimize
            chadlavy

            I made the change you described in my jbosscmp-jdbc.xml as follows:


            java:/MDRDBP01
            <datasource-mapping>DB2</datasource-mapping>
            <create-table>false</create-table>
            <remove-table>false</remove-table>
            <read-only>false</read-only>
            <pk-constraint>true</pk-constraint>
            <fk-constraint>true</fk-constraint>
            <page-size>100</page-size>


            It did not seem to help...

            Is there a way that I could override the sql using JBossQL or something like it in this file? I've seen people mention that the documentation for this is in the 'FULL DOCUMENTATION'. We purchased the electronic version of the JBoss Book 3.x and don't see any mention of JBossQL or the dynamic sql functionality that can be used in this file.