4 Replies Latest reply on Jun 20, 2004 6:39 PM by triathlon98

    on-load strategy limitations

    triathlon98

      I have an EJB-QL query which returns a lot of records.

      If I execute this using the default config (on-load), I get a OutOfMemoryException. This sounds logical as JBoss is trying to load all my entity beans in memory/cache (I am using commit option A if that matters).

      Just using on-load and changing the page-size only changes the number of queries which are generated (sounds logical).

      The easy solution if to change the read-ahead strategy to on-find. However, this completely kills performance and suddenly causes related records to be (completely) loaded as well.

      The "none" strategy seems to be the best current option, eben if this generates separate SQL wueries to the the link field for external links.

      Would it not be possible to have some kind of variant of on-load/page-size which does not immediately load all results, but loads the data in chunks (which basically is what I thought on-load is supposed to do).

      Joachim

        • 1. Re: on-load strategy limitations
          triathlon98

          More info, even the "none" strategy causes a OutOfMemoryException after a while. Even though the code runs in multiple transactions, things go wrong after a while.

          What's more the logs also show that one of the fields (which contains the key from a 1-N relationship) gets updated, even though the client code is read-only.

          Any ideas about how this can be fixed or workarounds ?

          Joachim

          • 2. Re: on-load strategy limitations
            triathlon98

            I also tried setting <max-capacity>200</max-capacity> in container-cache-conf, but I still get the OutOfMemory (this was with default on-load).

            Joachim

            • 3. Re: on-load strategy limitations
              triathlon98

              As I could not get any of the load strategies to work, and after re-reading the CMP chapter in the manual, I can only conclude that something is wrong with the preload cache. While the manual says the contents is linked with soft references, this does not seem to be the case, as the OutOfMemory seems to happen during this pre-loading.

              I also tested whether running this example inside or outside a transaction helps, but it does not seem to make a difference.

              Joachim

              • 4. Re: on-load strategy limitations
                triathlon98

                Seems fixed in 3.2.4

                Joachim