Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Slow factory.createEntityManager() with EcliseLink
Slow factory.createEntityManager() with EcliseLink [message #1704960] Tue, 11 August 2015 02:40 Go to next message
Eclipse UserFriend
Hello

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 10:46 Go to previous message
Eclipse UserFriend
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:
http://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/p_deploy_on_startup.htm


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


Current Time: Thu Jul 03 20:48:05 EDT 2025

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

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

Back to the top