why jsc+Ejb Slow as a snail ?

Hi All,In jsc, I get the DTO data from Ejb's method into datatable,only has 500 rows, displaying need 90 seconds, after modified by user , transfer the dto to Ejb's method for saving, need 120-150 seconds.I am about to collapse ! Help me,Thanks a lot!Smile
[293 byte] By [nsqsmilea] at [2007-11-26 14:23:00]
# 1

Your question can be tricky. I assume that you are using Java Studio Creator 2.1 with J2EE 1.4 EJBs.

A common pattern is to use an EJB Session Bean's remote method as a facade for an CMP EJB Entity Bean. If you are using this schema to build your 500 DTO list, then you are having the overhead of having many SELECT statements issued against your database. Anyway, for a 500 row result it should not take that time, unless you have more complex logic associated to your EJBs, or your hardware is not able to handle the load of the J2EE Application Server.

If you're expecting to have large results of this EJB Session remote method, is best to replace an CMP-Entity-EJB finder method for a direct JDBC call to improve performance. If you are using BMP EJBs, then you can add a business method with a JDBC call. Also, try to save your result list in your presentation layer (maybe a session bean) to avoid the execution of the remote method each time your table changes, is paginated or gets updated.

Best regards.

Antonio.

antoniovla at 2007-7-8 2:15:14 > top of Java-index,Development Tools,Java Tools...