Reputation: 634
I use the JPA with Eclipselink and Derby DB. I wonder if there is an option to improve the performance when initiating the process since the following code is invoked.
factory = Persistence.createEntityManagerFactory(persistenceUnitName);
There is delay and the process is invoked and writing status in the console.
Is there a way to omit that process and improve the performance?
Upvotes: 1
Views: 230
Reputation: 18379
Creating an EntityManagerFactory requires the persistence unit to be deployed. This is something you should only ever do once for the life of your application or server.
Since it is only done once, the performance should not be a major issue, unless you have architected your application poorly and are calling it multiple times.
Ways to improve the performance include:
<exclude-unlisted-classes>true</exclude-unlisted-classes>
, this avoids having to search the entire jar classpath.Upvotes: 1