RE: Avoiding N+1 on collection in recursive relation

2014-07-21 Thread Henno Vermeulen
I did find a workaround for this issue. It's idea can also be used to work around some other performance issues in JPA. The main idea is to efficiently prefetch any entity that OpenJPA would otherwise fetch with single find-by-id queries. Turn on OpenJPA trace and find out which entities are

RE: Avoiding N+1 on collection in recursive relation

2014-07-21 Thread David Minor
Unfortunately we have the data cache turned off - we use fetch groups fairly heavily, and we've found that they do not play well with the data cache (https://issues.apache.org/jira/browse/OPENJPA-1280 for instance). Another issue I found that complicated my situation was our class structure - the

Re: Create H2 database even before adding records

2014-07-21 Thread Rick Curtis
The configuration(openjpa.jdbc.SynchronizeMapping) you have provided should cause tables to be created the first time and EntityManager is created. Thanks, Rick On Sun, Jul 20, 2014 at 1:14 PM, Kalpa Welivitigoda callka...@gmail.com wrote: Hi, I am developing an application with H2 in

Re: Create H2 database even before adding records

2014-07-21 Thread Kalpa Welivitigoda
property name=javax.persistence.schema-generation.database.action value=drop-and-create/property entry in persistence.xml worked for me. Since it is a in memory database and used temporary, dropping at the end of the application ok for me. On Tue, Jul 22, 2014 at 12:40 AM, Rick Curtis