Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311899 - Enable weaving for persistence units with non-default persistence xml location
Summary: Enable weaving for persistence units with non-default persistence xml location
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 10:50 EDT by Tom Ware CLA
Modified: 2022-06-09 10:20 EDT (History)
3 users (show)

See Also:


Attachments
proposed changes (30.24 KB, application/octet-stream)
2010-05-06 11:24 EDT, Tom Ware CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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