2 Replies Latest reply: Sep 25, 2008 11:23 AM by 637883 RSS

    More efficient calls to the database for DVT Components

    637883
      Hi All,

      I have a dynamic application that allows the user to add gauges and graphs to a page. My problem is this: the user can have 10 gauges that pull from different columns in the same view so with each gauge is a completely separate call to the database. I would like some methodology to get data in as few trips as possible. For example: If 10 gauges pull from 10 different columns in one view I would like to retrieve the data in one pull and assign the values to the gauges so that instead of 10 calls, there is only one. This call could be to a function which would keep persistent data.

      I'm not sure if this will work or not, are there any ideas out there?

      Thanks,
      Mark
        • 1. Re: More efficient calls to the database for DVT Components
          Frank Nimphius-Oracle
          Mark,

          what about writing a managed bean that acts as the model for the graph instances. Then when instantiating the bean you query the binding layer for the data, cache it in the bean (ArrayList or Hashmap to have the graphs reading from it. This will make one access to the database for all.

          Alternatively, if the graph is based on a single iterator in ADF binding then there should be only one query required. You can e.g. set the iterator refresh to refresh if needed.

          Frank
          • 2. Re: More efficient calls to the database for DVT Components
            637883
            Hi Frank,

            Thanks for your thoughts.
            I'm currently implementing your idea of having the backing bean manage the tabularData.

            I think what we will do is write a function in the DB to pull all the data we need and return that data to calling method in the backing bean. It will then be sorted out into tabular data sets and distributed to each graph and gauge as needed.

            Mark