Can you turn on SQL trace so we can see what is being generated? Perhaps
posting your Entity would also shed some light on what is going on.

On Thu, Jul 14, 2011 at 4:08 AM, M. Walter <marc.wal...@sbb.ch> wrote:

> I have one single select query and the connection pool shows one connection
> being obtained.
>
> The entity has indeed many one-to-many and many-to-one relationships. So if
> that should be the problem I created a DTO which has only the primary key
> (Long) and a string. Then I used constructor expression filling up this DTO
> instead of the entity with all its dependencies (SELECT NEW MyDto(t.id,
> t.name) FROM Table t). I was very astonished about the fact that it just
> lasted as long as the original entity creation! How can this be explained?
> Nearly 27 seconds reading two fields from the database table and generating
> 60.000 DTOs? This is awfully low-performance! Are the JPA entities still
> generated with all relationships if constructor expressions are used?
>
> One thing: I'm using Oracle 11g, not 10g as written in my first posting.
>
> --
>
>


-- 
*Rick Curtis*

Reply via email to