views:

20

answers:

3

Hi,
I write application using JBOSS Seam with Richfaces. Unfortunately some pages of it load very long especially when I want to show about 100 rows (or more) in table .
Getting response from database takes about 2453 ms, so it is quite well. However the phase RENDER_RESPONSE takes about 23750 ms, so it is unacceptable. The object which i return has no EAGER connections.

Hope that somebody can help me or give some hint what else can I do to find problem.

Greetings, Fryta PS. Here you have log from my application: 09:49:52,125 INFO [[/my_aplication]] BEFORE - INVOKE_APPLICATION 5 - / my_aplication/Report.seam
09:49:54,578 INFO [Report] End generating report: 2453
09:49:54,578 INFO [[/my_aplication]] AFTER - INVOKE_APPLICATION 5 - / my_aplication/Report.seam
09:49:54,578 INFO [[/my_aplication]] BEFORE - RENDER_RESPONSE 6 - / my_aplication/Report.seam
09:49:54,687 INFO [Report] getResultList(): 1285314594687
09:49:54,687 INFO [Report] getResultList(): 1285314594687
09:49:54,687 INFO [Report] getResultList(): 1285314594687
09:49:54,687 INFO [Report] getResultList(): 1285314594687
09:49:54,687 INFO [Report] getResultList(): 1285314594687
09:49:54,718 INFO [Report] getResultList(): 1285314594718
09:50:18,437 INFO [Report] getResultList(): 1285314618437
09:50:18,437 INFO [Report] getResultList(): 1285314618437
09:50:18,468 INFO [[/my_aplication]] AFTER - RENDER_RESPONSE 6 - / my_aplication/Report.seam
09:50:18,890 INFO [TimingFilter]

09:50:18,890 INFO [TimingFilter] Total: 18258ms dla: /my_aplication/ Report.seam

+1  A: 

I see this line in your log:

getResultList(): 1285314594687

...repeated quite a lot. What does this call do? Does it just return a List that was initialized elsewhere? Or is it making a call to the database? If there is any sort of logic involved in the call, that could be where your slowdown is occurring.

Shadowman
A: 

I am pretty sure it occurs because you are lazy-loading associated entities. Because Seam has built-in support for Open Session in View pattern (which avoids LazyLoadingException), For each lazy associated entity, Hibernate hits the database You can override getResultList (or create your custom method) and load all of needed entities by using a single SQL query

Arthur Ronald F D Garcia
+1  A: 

I suggest you read this very great post on how you can speed up your JSF/Seam/Richfaces application written by Dan Allen (which is the author of Seam in Action)

Shervin