I now have a simple example of my performance problem.

There is a CMP entity bean called Profile. There is also a
session bean called ProfileControl. The findAll() method
in ProfileControl is a simple pass-through of the findAll()
method from the Profile class. The Factory class
is just a lookup class to instantiate the beans.

The problem is the line getting the value of the "id" field.
It must be going back to the database to get the value
because it takes anywhere from 50 to 100 milliseconds,
which I would expect to be close to zero since it is
just retrieving the value that should already be there.
So a Collection of 20 takes almost 2 seconds just
to get the id's.

Here is the code:

          ProfileControl profileControl  = Factory.getProfileControl();
          Collection collection = profileControl.findAll();

          Iterator iterator = collection.iterator();
          Long id = null;

          while(iterator.hasNext()) {
               Profile profile = (Profile)(iterator.next());
               id = profile.getId(); // problem line
          } 

How can I determine if it is going back to the database (ie, turn
debugging on so I can see the sql underneath) and why is it doing
this?

Thanks.





_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to