Community
Participate
Working Groups
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
Does the spec require the EMFBuilder service to be exported using the context of the bundle which defines the PU?
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.
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}").