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

Bug 311899

Summary: Enable weaving for persistence units with non-default persistence xml location
Product: z_Archived Reporter: Tom Ware <tom.ware>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, foerster, SebTardif
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed changes none

Description Tom Ware CLA 2010-05-06 10:50:27 EDT
Updates in bug 311234 allow a persistence.xml file location and name to be specified through the eclipselink.persistencexml property.

Update our code so persistence units specified this way can be weaved.
Comment 1 Tom Ware CLA 2010-05-06 11:24:30 EDT
Created attachment 167324 [details]
proposed changes

These updates allow you to use the eclipselink.persistencexml property to specify the location of persitence.xml and enable weaving.

For Dynamic weaving with the java agent this must be specified as a system property since we will not be able to find the persistence.xml without the property.  (i.e. you are still required to have a single location and name for persistence.xml within all your persistence units.)
Comment 2 Tom Ware CLA 2010-05-06 13:41:46 EDT
Checked in fix.

Reviewed by Chris Delahunt

Tested manually.
Comment 3 Tom Ware CLA 2010-05-06 13:53:10 EDT
eclipselink.persistence.xml property must be provided to enable this to work

Limitations:

1. When using with agent-based dynamic weaving this property may only define a single location and therefore all persistence units must use that location

2. Java EE servers will still follow the specification (and look for META-INF/persistence.xml), so when using an alternate persistence.xml location, you will not be able to use injection, and you will not get dynamic weaving

3. You will have to specify the location of the persistence.xml file using the -persistencexml argument when using the static weaver (or ther persistencexml attribute in the ant tast)
Comment 4 Tom Ware CLA 2010-05-07 15:23:36 EDT
Additional Limitation. persistencexml must be a location contained within the base persistence unit location. i.e. don't use ".." in the persitence unit location.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:20:32 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink