Community
Participate
Working Groups
When a bundle containing persistence units is registered the persistence unit should be processed as is done by the Java Agent to ensure that byte code weaving transformers are registered as early as possible. I prototyped/hacked a solution to this by having OSGiPersistenceInitializationHelper.addBundle create an EntityManagerFactory for each persistence unit contained in a bundle. Obviously this is not the right solution but it did achieve the end of having predeployment performed before client code eventually called createEntityManagerFactory (hopefully not having previously loaded Entity classes). Most of the necessary predeployment code executed when starting with the agent is contained in JavaSECMPInitializer. Ideally the required functionality would be refactored so it's available to EquinoxInitializer, and maybe OSGiInitializer.
The solution to this problem should be as cheap/quick to implement as possible as EclispeLink JPA OSGi support will be replaced by Gemini JPA.
2.1 Bug scrubbing, deferring to 2.1.1.
With the support in Gemini coming this optimization is unnecessary.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink