6 Replies Latest reply on Apr 16, 2003 4:28 AM by miloud

    ***!30 seconds for a simple jsp!***

    miloud

      Hi,

      I'm new to EJBs and don't know what are there optimal performances.
      I use BMP beans on jboss 3.0.3 with tomcat4
      I have the folllowing code in my jsp :
      ----------------------------------
      (categoryHome.findByPrimaryKey(csc.getCatId())).getCatName()
      ----------------------------------
      it takes about 0.2 seconds ... but the page contains about 150 times that request (in a loop) => we have to wait a least 30seconds !
      Is there a better way to code ? Is this delay normal ?

      Thanks in advance !

        • 1. Re: ***!30 seconds for a simple jsp!***
          miloud

          Precision : I use a Bi Pentium 4 1Ghz and have 512Mo of RAM

          • 2. Re: ***!30 seconds for a simple jsp!***
            miloud

            Second precision : The table only have 70 rows and there is only 1 user for the moment

            • 3. Re: ***!30 seconds for a simple jsp!***
              lafr

              I can search and retrieve 167 out of ~6000 address beans and display some attributes of them in my client app in no more than 2 sec.
              Machine is smaller than yours. I prefer CMP.

              So the poor performance you get may be caused by
              - bad jboss config
              - slow db access
              - slow findByPrimaryKeyMethod implementation
              - bad deployment desc
              - ....

              Which jboss config do you use ? all or default or your own ?
              Which dbms do you use ?
              Of which class is csc of ?
              Do getCatId() and getCatName() more than a return ?
              How does your method findByPrimaryKey() look like ?

              Perhaps we can find out something more then.

              • 4. Re: ***!30 seconds for a simple jsp!***
                raja05

                Write your own finder method that would return a Collection of all the 150 beans , instead of doing a findByPrimaryKey for 150 times. That would be only one request to teh server, which would return all the 150 objects.

                -Raj

                • 5. Re: ***!30 seconds for a simple jsp!***
                  miloud

                  thanx lafr for your answer ! here are more informations :
                  i work with
                  - jboss 3.0.3 default config.
                  - SqlServer2000
                  - the findByPrimaryKey itself takes between 0 and 15 ms but a call to this method in the jsp takes 150 ms.
                  - The ejb are 1.x generated by Jbuilder6 and so is the deployement descriptor.

                  I think I can't make local calls since I use 1.x ejbs, can I ?

                  • 6. Re: ***!30 seconds for a simple jsp!***
                    miloud

                    thanx raja ! I know that the call to the ejb is very slow and that a single access would be really faster but since we are a team working on this project we can't easily modify and redeploy the ejbs.