On Wed, 19 Dec 2012 06:47:29 -0200, John <[email protected]> wrote:

Hi,

Hi!

I've converted a legacy JSP webapp over to Tapestry5+JPA and I suspect the JPA layer may be slowing down some query responses because of the overhead of building collections in the JPA or DAO layers.

Believe me, when you think JPA or Hibernate are slowing down queries, actually you're not using JPA or Hibernate well, probably falling in the n + 1 selects problem. Have you checked the generated SQL queries? If no, do it. Map associations fields as lazy loaded and probably your problem will go away.

I am wondering if it's feasible to have a mixin or alter a loop/grid component so that it loops over the result set directly and avoids the above problem? Are there any components like this already, or would it be easy to accomplish by modifying an existing compnenent?

For Grid, implement a ResultSet-backed GridDataSource. That's the only thing you need to do. But I still think you should improve your ORM mapping before attempting other solutions.

--
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to