Performance hit when creating Entity Beans to insert 8000 rows

Discussions

Performance and scalability: Performance hit 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, that's the architecture we have to comply with. Is there anything that I can do to increase the performance by reducing the processing time? Thanks in advance.
  2. sorry, this should have been under the Performance forum.
    -sP
  3. The problem is that your likely creating 8000 EJBs, one for each row. It might be better to push the row insertion back to the database server by invoking a stored procedure in the EJB. Then only one instance is required.
  4. Entity beans are a nice abstraction, but I fear you've hit one of the situations in which they simply have too much overhead. I would use JDBC in a session bean to do the update: this way your server won't need to create 8000 objects.