Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Soliciting Ideas for Dealing with Initial Entity Manager Creation Lag

Hi Tim,

Tim Hollosy wrote:
We've begun integrating EclipseLink into an RCP business application.
One interesting problem is on the fist call to createEntityManager()
there is a significant lag as I assume all the Entities are loaded and
other magic stuff goes on, so users aren't really expecting to have to
wait the first time they do a search, or load an editor.
No entities are loaded but we are very lazy and don't really do any work until you create your first EntityManager.
One idea we had was to simply turn off lazy loading of a plugin and
creating an initial entity manager in a job, then disposing it. Users
are used to waiting during the initial load. One problem is if you
wanted the plugins to load on startup you'd have to turn off lazy
loading which uses more memory for plugins the users may not even use
that session.
How about refactoring your domain model and persistence related artifacts (like persistence.xml) into a separate plugin that is eagerly loaded. The rest of your app (editors, etc.) could still be lazy?  In your eager plugin I'd create an EntityManager and then close it just to force the processing of your entities (we need to examine the annotations and any mapping files) and creation of your connection pools.  Also, you will probably want to dial down the number of connections in your pools to a couple.  This has a big impact on startup time.  I think I was doing this in the RCP example in the OSGi POC SVN branch?



Shaun Smith | Principal Product Manager, TopLink | +1.905.502.3094
Oracle Fusion Middleware
110 Matheson Boulevard West, Suite 100
Mississauga, Ontario, Canada L5R 3P4

Back to the top