3 Replies Latest reply on Apr 9, 2006 6:25 AM by epbernard

    Data Retrieval Performance

    djeley

      Hi,

      With EJB 3, and in particular Jboss's implementation, do we still need to worry about data retrieval performance like we do with EJB 2.x finder methods?

      From Core J2EE Patterns (ValueListHandler):
      "Finder methods may have considerable overhead when used to find large numbers of result objects. The container may create a large number of infrastructure objects to facilitate the finders."

      Regards,

      Duncan Eley

        • 1. Re: Data Retrieval Performance
          triathlon98

          In my experience you have to make sure your results do not contain too many records. If they do, then the query will slow down.

          Another thing to consider is that a flush on the entitymanager can be slow if it contains many objects. If you know the objects are unchanged, it may be best to clear the entitymanager before the implicit flush occurs.

          Hope this helps,
          Joachim

          • 2. Re: Data Retrieval Performance
            ejb3workshop

            I think the short answer is yes. I would not recommend EJB3 persistence to be used for report generatation, which typically requires large datasets to be loaded and processed. Vanilla SQL can perform a much better job at that and provides more flexiblity.

            Were EJB3 is great is providing a elegant Object-Relational mapping for business services. Tasks like fetching a single contact with attached addresses are ideally suited for it.

            Hope this helps
            Alex
            ejb3workshop.com

            • 3. Re: Data Retrieval Performance
              epbernard

               

              "ejb3workshop" wrote:
              I think the short answer is yes. I would not recommend EJB3 persistence to be used for report generatation, which typically requires large datasets to be loaded and processed. Vanilla SQL can perform a much better job at that and provides more flexiblity.


              EJBQL Report queries are as fast as SQL report queries. Projection has been introduced for that.