Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312692

Summary: Transformers should be configured when Persistence Bundle registered
Product: z_Archived Reporter: Shaun Smith <shaun.smith>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: osgi

Description Shaun Smith CLA 2010-05-12 15:15:16 EDT
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.
Comment 1 Shaun Smith CLA 2010-05-12 15:16:33 EDT
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.
Comment 2 Peter Krogh CLA 2010-06-04 14:39:17 EDT
2.1 Bug scrubbing, deferring to 2.1.1.
Comment 3 Shaun Smith CLA 2010-07-28 10:24:30 EDT
With the support in Gemini coming this optimization is unnecessary.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:19:46 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink