3 Replies Latest reply on Aug 29, 2001 8:44 AM by mkaseman

    Alternatives to multi-row finder methods

    hraun

      Hi,
      just to rephrase my earlier question.
      What are people using instead of multi-row finder methods which return Collections/Enumerations of remote references?
      I understand they can be rather inefficient.
      CHeers
      Peet

        • 1. Re: Alternatives to multi-row finder methods
          tbfmicke


          The alternative is to use JDBC directly and query the table for the wanted rows. If you are using a Data Access Object (DAO) its possible to use the same DAO that the EJB uses for this reading.

          There is a pattern among suns J2EE patterns called "Fast Lane Reader" that shows this.

          http://java.sun.com/j2ee/blueprints/design_patterns/fast_lane_reader/index.html

          Regards

          • 2. Re: Alternatives to multi-row finder methods
            hraun

            Thanks for this,
            That turned out to be quite a handy link.
            The benefit of using multi-row finder methods is, of course, that if correctly implemented, the user can view an excerpt of data from the bean, then you then have everything you need to go and retrieve the specific bean he is interested in. But since that creates quite an overhead, I was looking for an alternative.
            In a previous post, I asked whether it was advisable to create a primary key object with several fields, to allow the user to view a list of bean descriptions, from which he can decide which bean he'd like to load. The primary key would then serve two purposes; a brief description of the bean, and the means by which to find the bean.

            What do you think?

            Regards
            Peet

            • 3. Re: Alternatives to multi-row finder methods
              mkaseman

              look at my post in the ejb forum titled "right or wrong way to do CMP/SLSB". i was looking for the same high-speed access you are, but still use cmp and entity beans.