Performance Issue when creating Entity Beans to insert 8000 rows


Performance and scalability: Performance Issue when creating Entity Beans to insert 8000 rows

  1. I am trying to create Entity Beans to insert 8000 rows in the database and facing a major performance problem. It is taking a good 5 minutes to complete the process. We use CMP with Inprise App Server in our shop. Is there anything that I can do to increase the performance by reducing the processing time? Thanks in advance.
  2. I wouldn't use an entity bean for the job. I 'd use a stateless session bean, if I choose to use EJB at all. EJB is not meant for bulk database operation, IMHO.
  3. You have to use JDBC instead of EJB in this issue. :-)
  4. hi sheetal

    i understood ur problem, so what u should do means, see here
    there are 8000 rows which need to be inserted through an entity bean, so naturally entity means it represents a row in database, so it takes a lot of memory(object instance) for 8000 rows,what u can do is user weblogic performance pack , or u write a broker bean which is stateless which in turn interact with the entity.

  5. Hi Sheetal,

    I would also advise a Session bean to wrap an entity bean as it has been to proved to give a good results. By the way is your entity bean , a CMP or a BMP.
    BMP will take more time than CMP as everything that BMP is doing will strored in the Container.

  6. Sheetal, generally in this case going with JDBC from the client or from a session bean will yield the desired results provided you do not care about the caching benefits of the Entity Beans. Performance improvements can only be achieved by understanding the bottleneck in the overall design, otherwise you will end up pushing the problem from one area to another area of your application.
    Wrapping the entity beans with Session Beans is a good design practice and sometimes you also get performance benefits from bulk methods. But in this case, do not waste your time it will not get you the performance gain you are looking for (assuming that your clients need to create one bean/row at a time).
    Does Inprise App Server support EJB 2.0? If yes, then try using EJB 2.0 CMP, they should be much faster.