1 Reply Latest reply on Feb 6, 2007 2:41 PM by gavin.king

    Performace ISSUES with JBoss Seam, Hibernate and EJB 3.0

      Hi all,

      Around 5 months ago we embarked on a project for one of our major clients. While

      doing the design and planning for this project, we came across jboss and some of its

      pioneering frameworks such hibernate, seam and the latest ejb 3.0 which was just what we

      were looking for. As such, we stared building a web application using these frameworks and

      our main aim was to use JBoss Seam and Hibernate to speed up development of the application

      using EJB.

      While the first phase was hardwork, especially with the initial configs we had to make, we

      were satisfied with the way Seam was helping us in the development. Our project structure

      is as follows:

      Models - Entity Beans generated using Hibernate Tools with Annotations

      Controllers - This part consisted of two layers :

      - One layer for DataAccessObjects which consisted of SLSB and is aimed at

      containing all hibernate specific code that return entities

      - Another layer for Actions which consisted of SLSB and SFSB and is aimed at

      interacting with the View layer

      View - All JSF/Facelet components

      Our approach was to have the the view model fetching information from the Action Layer

      which in turn calls the DAO layer when querying DB

      We were not too familiar with CONVERSATIONS at that time and implemented our SFSB without

      this feature.

      While the above approach works fine, we are getting some performance related issues :

      (1) We get Out of Memory Leaks related to the PermGen Space. We have managed to have a

      workaround for this by increasing the MaxPermGen size. However, we fear this might only be

      a temporary fix

      (2) The application is really slow because of the amount of Session beans that are involved

      in it and the amount of code that hibernate autogenerates when fetching dependencies. There are no heavy graphics involved.

      We would like to know if the above problems can be solved by :

      (a) Implementing conversations ( Will this improve response time)

      (b) Porting the application to Tomcat running embedded-ejb can improve the response time

      Any other suggestions are also most welcomed.

      We are on a tight deadline and would really appreciate any help on this from you experts.

      Best Regards,
      Yogesh Jankee,
      M-ITC LTD

        • 1. Re: Performace ISSUES with JBoss Seam, Hibernate and EJB 3.0

          It's *really* hard to debug OOME, since there could be so many different causes.

          Yes, possibly the use of stateful session beans without well defined conversations *could* be a cause of this - however, SFSB passivation and timeout is supposed to protect you from this. Try adjusting the timeout.

          I don't see why an application should be slow because of having many session beans. It seems that the real problem is that you need to tune the association fetching strategies used by Hibernate, and possibly use some caching.