Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330790 - Gemini JPA registers EMFBuilder service using its own bundle context
Summary: Gemini JPA registers EMFBuilder service using its own bundle context
Status: NEW
Alias: None
Product: Gemini.JPA
Classification: RT
Component: Core (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael Keith CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 07:11 EST by Sahoo CLA
Modified: 2012-10-09 10:44 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sahoo CLA 2010-11-22 07:11:00 EST
I am trying out the Gemini/JPA sample. I am on Gemini/JPA 1.0.0.M3 and Felix. After I started the sample bundle, I was hoping to see EMFBuilder service being exported by the sample bundle, but as the following output shows, it is actually registered using Gemini's own bundle context:

g! inspect s c 7
Gemini JPA (Incubation) (7) provides services:
----------------------------------------------
javax.persistence.provider = org.eclipse.persistence.jpa.PersistenceProvider
objectClass = javax.persistence.spi.PersistenceProvider
osgi.jpa.provider.version = 1.0.0.M3-incubation
service.id = 16
----
objectClass = org.osgi.service.jpa.EntityManagerFactoryBuilder
osgi.managed.bundles = org.eclipse.gemini.jpa.samples_1.0.0.M3-incubation
osgi.unit.name = Accounts
osgi.unit.provider = org.eclipse.persistence.jpa.PersistenceProvider
osgi.unit.version = 1.0.0.M3-incubation
service.id = 17
Comment 1 Gunnar Wagenknecht CLA 2012-01-04 06:40:37 EST
Does the spec require the EMFBuilder service to be exported using the context of the bundle which defines the PU?
Comment 2 Michael Keith CLA 2012-01-04 11:18:04 EST
Strictly speaking it does. The reason was that it was supposed to ensure class space consistency when looking up the services, but in practice, because the entity classes are not part of the service, it wouldn't provide the consistency you would expect.
Comment 3 Thomas Gillet CLA 2012-10-09 10:44:12 EDT
I'm also concerned by this bug, because I'm trying to retrieve the persistence bundle used to publish an EMF/EMFB.

The workaround is to use the "osgi.managed.bundles" service property, but this is Gemini specific (and the property value needs parsing since it is formatted as "{bsn}_{version}").