Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335698 - I would like to load a persistence unit from fragment bundles
Summary: I would like to load a persistence unit from fragment bundles
Status: NEW
Alias: None
Product: Gemini.JPA
Classification: RT
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael Keith CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-28 10:43 EST by Ed Pichler CLA
Modified: 2013-01-09 02:16 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Pichler CLA 2011-01-28 10:43:44 EST
Build Identifier: All builds

I don't know if it was forgotten or if is correct.

But If I put the file persistence.xml and declare JPA-Persisten-units inside fragment classes, the eclipse link doesn't found it.

Other bug (or not) is, if I want to load the persistence units from a separeted bundle, that bundle needs to see the JDC Driver, and not the bundle where I'm creating the Entity Manager (that obviously, has the Eclipse Link dependency declared) 

Reproducible: Always

Steps to Reproduce:
1.Create a fragment bundle and declare the persistence.xml file, and the "JPA-persistentUnits" parameter on his MANIFEST.MF file.
2.Create another bundle (the host bundle) and create a EntityManager loading that declared persistent unit. (the error is here, the persistent hadn't found.

--to get other problem
3. modify the fragment bundle to be a normal bundle, that depends on the other bundle created.
4. try to create the entity manager againg
5. the persistent unit had found, but the jdbc driver(declared on the old host bundle) not. 
6. Now modify the new bundle, adding the jdbc drive dependency. Now all works fine.

I'm not sure if this is bug or enhancement. I think is to be analysed if there are some concept I'm ignoring.

Thanks all!
Comment 1 Shaun Smith CLA 2011-02-03 09:58:41 EST
Hi Ed,

   New feature work on JPA in OSGi has moved to the Eclipse Gemini JPA project which is building OSGi Enterprise Specification compliant JPA support on top of EclipseLink. As such, we aren't going to be investing any further energy on the "legacy" EclipseLink OSGi code base.  I've therefore changed the Product for this enhancement request to "Gemini JPA".

   Shaun
Comment 2 Ed Pichler CLA 2011-02-03 10:56:22 EST
I didn't know.
Many thanks!
Comment 3 Jad Naous CLA 2013-01-09 02:16:18 EST
You can use the config admin support to workaround this issue. That's how I do it.