Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Slow factory.createEntityManager() with EcliseLink
Slow factory.createEntityManager() with EcliseLink [message #1704960] Tue, 11 August 2015 06:40 Go to next message
mark br is currently offline mark brFriend
Messages: 1
Registered: August 2015
Junior Member

i make my first steps into the land of JPA and EcliseLink
I wrote a small test programm to fill a h2db database with 100 mio records to test query times.

My problem is, that when i am restarting my test programm the startup takes 30 minutes!

The line where my programm hangs is:
private static EntityManager em = factory.createEntityManager();

It seems so that this line triggers a complete read of all 100 mio entries in my DB?!

But why? And how do i avoid it?

I attached my persistence xml

PS: I made another test with pure jdbc. My test programm (counting all lines of my table) is finished in 1 second

Re: Slow factory.createEntityManager() with EcliseLink [message #1705169 is a reply to message #1704960] Wed, 12 August 2015 14:46 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
As far as I have ever seen, EclipseLink will not read your entities when it starts up a context.

Your persistence properties include:
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode"
value="database" />
<property name="eclipselink.logging.level.sql" value="FINE"/>

The ddl generation options will cause EclipseLink to create the tables when the context is first accessed. If the tables are already there, this and the FINE level of logging might be taking longer than you expect - the error on each statement will be logged.
Try going through the logs as they are logged to see what might be taking the time, as well as timing it with logging and DDL generation turned off.

If you want, you can also pay these costs earlier, when the factory is first obtained using the "eclipselink.deploy-on-startup" property:

Previous Topic:EclipseLink concept documentation for the query result cache possibly outdated.
Next Topic:cache coordination & Jgroups
Goto Forum:

Current Time: Fri Mar 01 05:41:38 GMT 2024

Powered by FUDForum. Page generated in 0.02194 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top