Skip to Content

ejb performance


I've got a MySQL db with ~ 1500 rows. When doing a select through an entity ejb it take ~2500ms to execute a given request. It takes ~250 ms when I access the data base directly on the client. My ejb is ten times slower than a direct access by the client, is that normal? My bean is on a WEB AS in debug mode is that the problem? It seems that the "ejbStore" method is called for each result when I call a find method, why?

Best regards


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 17, 2004 at 01:21 PM


    We have an existing application that began with +- 50 entity beans. As the application was being built, they appeared to work well with the sample data in oracle. But...when it hit production, and volume became a factor, the entity beans, in some situations, were disastrous. They performed terribly. Since the application's first deployment, about 4-5 years ago, we've had to methodically replace many of them that were behaving as bottlenecks.

    This behaviour has been observed by many, including some IBM experts who were auditing our application, who insisted that we no longer use entity beans because of their performance.

    My observations:

    Entity beans seem to do ok for updating the db, because most of the time there are only a few objects to save...However, extracting data has always been more complicated. If you use entity beans (especially with table mapping), it becomes long and arduous to navigate the db scheme using entity beans because often you have to create lots of them in order to get a simple list of items which have been moderately normalised in the db.

    In order to benefit from the transactional aspects of EJB's we have adopted the SessionFacade (session stateless) pattern. This way we pass ValueObjects back and forth from the session facade. Stateless Session beans still suffer from the EJB framework overhead, but often the container keeps them alive so they do not have to be instanciated as often as an entity bean. With this method, however, we have to write our own SQL's...but in the case of data extranction, specific/personalized SQL's will always outgun generated SQL's.

    Just some ideas,


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 18, 2004 at 04:32 PM

    Besides the other recommendations about architecture it is a clear YES abotu debugging slowing down your application. NEVER do performance testing in debug state.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.