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

    Need to optimize

    Chad Lavy Newbie


      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
          Adrian Brock Master



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


          • 2. Re: Need to optimize
            Chad Lavy Newbie

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


            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.