You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Erwin Hogeweg <er...@me.com> on 2017/01/05 13:31:03 UTC

JPA Container - Unexpected EntityManagerFactory Service Registration

Hi,

I am seeing a strange (wildly confusing) service registration when using the Aries JPA Container with Equinox. Not sure where the problem is, so I figured I start here.

When the DataSource and the PersistenceProvider are available the container registers the EntityMangerFactory* services. However, the EntityManagerFactoryBuilder Service shows up as being registered by the container bundle while the EntityMangerFactory Services shows up as being registered by the bundle that provides the persistence unit.

g! b 53
org.apache.aries.jpa.container_2.3.0 [53]
  Id=53, Status=ACTIVE      Data Root=...
  "Registered Services"
    {org.osgi.framework.hooks.weaving.WeavingHook}=...
    {org.osgi.service.cm.ManagedService}=...
    {org.osgi.service.jpa.EntityManagerFactoryBuilder}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=119, service.bundleid=53, service.scope=singleton}
  Services in use:
    {javax.sql.DataSource}=...
    {javax.persistence.spi.PersistenceProvider}=...

g! b 111
com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
  Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.eclipse.osgi/111/data
  "Registered Services"
    {javax.persistence.EntityManagerFactory}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=125, service.bundleid=111, service.scope=singleton}
  No services in use.

This is with equinox 3.10.2.v20150203-1939, J8.

BTW, I see the same thing happening with the mysql and the pax-jdbc-config bundles. The DataSourceFactory service shows as being registered by the mysql bundle, while it is actually registered by the config bundle.

What am I missing here? Is this a feature, a bug, or is my brain not flexible enough to comprehend this? 


Thanks,

Erwin

Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Christian Schneider <ch...@die-schneider.net>.
Yes you are right. The mysql bundle does not create the DSF. So you 
still need pax-jdbc-mysql.

Christian

On 09.01.2017 18:30, Erwin Hogeweg wrote:
> Christian,
>
> Thanks.
>
>> I think the mysql driver indeed registers the DSF. You might need to 
>> provide the bundle for the DataSourceFactory api though. Can you try 
>> that?
> The DataSourceFactory is exported by the enterprise bundle (Ugh, I 
> didn\u2019t really write that\u2026 that shouldn\u2019t even be in my runtime).
>
> g! packages org.osgi.service.jdbc
> osgi.wiring.package; bundle-symbolic-name="osgi.enterprise"; 
> bundle-version:Version="5.0.0.201203141834"; 
> version:Version="1.0.0"; osgi.wiring.package="org.osgi.service.jdbc"; 
> uses:="javax.sql"<osgi.enterprise_5.0.0.201203141834 [7]>
>   org.apache.aries.jpa.container_2.3.0 [51] imports
>   org.ops4j.pax.jdbc.pool.common_0.9.0 [60] imports
>   org.ops4j.pax.jdbc.pool.dbcp2_0.9.0 [58] imports
>   org.ops4j.pax.jdbc.config_0.9.0 [59] imports
>   org.ops4j.pax.jdbc_0.9.0 [57] imports
>
> I also don\u2019t see that package imported by the mysql bundle.
>
> Erwin
>
>>
>> Christian
>>
>> 2017-01-06 18:18 GMT+01:00 Erwin Hogeweg <erwin.hogeweg@me.com 
>> <ma...@me.com>>:
>>
>>     Thanks,
>>
>>     I can see the reasoning. That is confusing though. I thought that
>>     the MySQL driver now registered the DSF, just like the h2 bundle,
>>     so I removed the pax-jdbc bundles... after which the MySQL bundle
>>     did NOT 'register' the DSF anymore :-)
>>
>>     Erwin
>>
>>     El ene. 6, 2017, a las 10:30, Christian Schneider
>>     <chris@die-schneider.net <ma...@die-schneider.net>> escribi�:
>>
>>>     I think the behaviour of pax-jdbc is correct. It should register
>>>     the DSF in the name of the jdbc provider bundle.
>>>
>>>     Christian
>>>
>>>     2017-01-06 13:52 GMT+01:00 Erwin Hogeweg <erwin.hogeweg@me.com
>>>     <ma...@me.com>>:
>>>
>>>         Christian,
>>>
>>>>         On Jan 6, 2017, at 2:22 AM, Christian Schneider
>>>>         <chris@die-schneider.net <ma...@die-schneider.net>>
>>>>         wrote:
>>>>
>>>>         That might be a bug. I think jpa container should register
>>>>         both EntityManagerFactoryBuilder and EntityManagerFactory
>>>>         in the name of the persistence bundle.
>>>>         Can you open an issue for this?
>>>>
>>>         Sure: https://issues.apache.org/jira/browse/ARIES-1652
>>>         <https://issues.apache.org/jira/browse/ARIES-1652>
>>>
>>>         Do you want me to open a separate one for the
>>>         pax-jdbc-config bundle? I believe that bundle has the same
>>>         author(s)\u2026
>>>
>>>         Erwin
>>>>         Christian
>>>>
>>>>         2017-01-05 14:31 GMT+01:00 Erwin Hogeweg
>>>>         <erwin.hogeweg@me.com <ma...@me.com>>:
>>>>
>>>>             Hi,
>>>>
>>>>             I am seeing a strange (wildly confusing) service
>>>>             registration when using the Aries JPA Container with
>>>>             Equinox. Not sure where the problem is, so I figured I
>>>>             start here.
>>>>
>>>>             When the DataSource and the PersistenceProvider are
>>>>             available the container registers the
>>>>             EntityMangerFactory* services. However, the
>>>>             EntityManagerFactoryBuilder Service shows up as being
>>>>             registered by the container bundle while the
>>>>             EntityMangerFactory Services shows up as being
>>>>             registered by the bundle that provides the persistence
>>>>             unit.
>>>>
>>>>             g! b 53
>>>>             org.apache.aries.jpa.container_2.3.0 [53]
>>>>               Id=53, Status=ACTIVE  Data Root=...
>>>>             *"Registered Services"*
>>>>             {org.osgi.framework.hooks.weaving.WeavingHook}=...
>>>>                 {org.osgi.service.cm
>>>>             <http://org.osgi.service.cm/>.ManagedService}=...
>>>>             *{org.osgi.service.jpa.EntityManagerFactoryBuilder}*={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222,
>>>>             osgi.unit.name <http://osgi.unit.name/>=my.pu,
>>>>             osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider,
>>>>             service.id <http://service.id/>=119,
>>>>             *service.bundleid=53*, service.scope=singleton}
>>>>               Services in use:
>>>>             {javax.sql.DataSource}=...
>>>>             {javax.persistence.spi.PersistenceProvider}=...
>>>>
>>>>             g! b 111
>>>>             com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>>>>               Id=111, Status=ACTIVE  Data
>>>>             Root=/Users/erwin/.../org.eclipse.osgi/111/data
>>>>             *"Registered Services"*
>>>>             *{javax.persistence.EntityManagerFactory}*={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222,
>>>>             osgi.unit.name <http://osgi.unit.name/>=my.pu,
>>>>             osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider,
>>>>             service.id <http://service.id/>=125,
>>>>             *service.bundleid=111*, service.scope=singleton}
>>>>               No services in use.
>>>>
>>>>             This is with equinox 3.10.2.v20150203-1939, J8.
>>>>
>>>>             BTW, I see the same thing happening with the mysql and
>>>>             the pax-jdbc-config bundles. The DataSourceFactory
>>>>             service shows as being registered by the mysql bundle,
>>>>             while it is actually registered by the config bundle.
>>>>
>>>>             What am I missing here? Is this a feature, a bug, or is
>>>>             my brain not flexible enough to comprehend this?
>>>>
>>>>
>>>>             Thanks,
>>>>
>>>>             Erwin
>>>>
>>>>
>>>>
>>>>
>>>>         -- 
>>>>         -- 
>>>>         Christian Schneider
>>>>         http://www.liquid-reality.de
>>>>         <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>>>
>>>>         Open Source Architect
>>>>         http://www.talend.com
>>>>         <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>>>
>>>
>>>
>>>
>>>     -- 
>>>     -- 
>>>     Christian Schneider
>>>     http://www.liquid-reality.de
>>>     <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>>
>>>     Open Source Architect
>>>     http://www.talend.com
>>>     <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>>
>>
>>
>>
>> -- 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de 
>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>
>> Open Source Architect
>> http://www.talend.com 
>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Erwin Hogeweg <er...@me.com>.
Christian,

Thanks.

> I think the mysql driver indeed registers the DSF. You might need to provide the bundle for the DataSourceFactory api though. Can you try that?
The DataSourceFactory is exported by the enterprise bundle (Ugh, I didn’t really write that… that shouldn’t even be in my runtime).

g! packages org.osgi.service.jdbc
osgi.wiring.package; bundle-symbolic-name="osgi.enterprise"; bundle-version:Version="5.0.0.201203141834"; version:Version="1.0.0"; osgi.wiring.package="org.osgi.service.jdbc"; uses:="javax.sql"<osgi.enterprise_5.0.0.201203141834 [7]>
  org.apache.aries.jpa.container_2.3.0 [51] imports
  org.ops4j.pax.jdbc.pool.common_0.9.0 [60] imports
  org.ops4j.pax.jdbc.pool.dbcp2_0.9.0 [58] imports
  org.ops4j.pax.jdbc.config_0.9.0 [59] imports
  org.ops4j.pax.jdbc_0.9.0 [57] imports

I also don’t see that package imported by the mysql bundle.

Erwin

> 
> Christian
> 
> 2017-01-06 18:18 GMT+01:00 Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>>:
> Thanks,
> 
> I can see the reasoning. That is confusing though. I thought that the MySQL driver now registered the DSF, just like the h2 bundle, so I removed the pax-jdbc bundles... after which the MySQL bundle did NOT 'register' the DSF anymore :-)
> 
> Erwin
>  
> El ene. 6, 2017, a las 10:30, Christian Schneider <chris@die-schneider.net <ma...@die-schneider.net>> escribió:
> 
>> I think the behaviour of pax-jdbc is correct. It should register the DSF in the name of the jdbc provider bundle.
>> 
>> Christian
>> 
>> 2017-01-06 13:52 GMT+01:00 Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>>:
>> Christian,
>> 
>>> On Jan 6, 2017, at 2:22 AM, Christian Schneider <chris@die-schneider.net <ma...@die-schneider.net>> wrote:
>>> 
>>> That might be a bug. I think jpa container should register both EntityManagerFactoryBuilder and EntityManagerFactory in the name of the persistence bundle.
>>> Can you open an issue for this?
>>> 
>> Sure: https://issues.apache.org/jira/browse/ARIES-1652 <https://issues.apache.org/jira/browse/ARIES-1652>
>> 
>> Do you want me to open a separate one for the pax-jdbc-config bundle? I believe that bundle has the same author(s)…
>> 
>> Erwin
>>> Christian
>>> 
>>> 2017-01-05 14:31 GMT+01:00 Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>>:
>>> Hi,
>>> 
>>> I am seeing a strange (wildly confusing) service registration when using the Aries JPA Container with Equinox. Not sure where the problem is, so I figured I start here.
>>> 
>>> When the DataSource and the PersistenceProvider are available the container registers the EntityMangerFactory* services. However, the EntityManagerFactoryBuilder Service shows up as being registered by the container bundle while the EntityMangerFactory Services shows up as being registered by the bundle that provides the persistence unit.
>>> 
>>> g! b 53
>>> org.apache.aries.jpa.container_2.3.0 [53]
>>>   Id=53, Status=ACTIVE      Data Root=...
>>>   "Registered Services"
>>>     {org.osgi.framework.hooks.weaving.WeavingHook}=...
>>>     {org.osgi.service.cm <http://org.osgi.service.cm/>.ManagedService}=...
>>>     {org.osgi.service.jpa.EntityManagerFactoryBuilder}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name <http://osgi.unit.name/>=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id <http://service.id/>=119, service.bundleid=53, service.scope=singleton}
>>>   Services in use:
>>>     {javax.sql.DataSource}=...
>>>     {javax.persistence.spi.PersistenceProvider}=...
>>> 
>>> g! b 111
>>> com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>>>   Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.eclipse.osgi/111/data
>>>   "Registered Services"
>>>     {javax.persistence.EntityManagerFactory}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name <http://osgi.unit.name/>=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id <http://service.id/>=125, service.bundleid=111, service.scope=singleton}
>>>   No services in use.
>>> 
>>> This is with equinox 3.10.2.v20150203-1939, J8.
>>> 
>>> BTW, I see the same thing happening with the mysql and the pax-jdbc-config bundles. The DataSourceFactory service shows as being registered by the mysql bundle, while it is actually registered by the config bundle.
>>> 
>>> What am I missing here? Is this a feature, a bug, or is my brain not flexible enough to comprehend this? 
>>> 
>>> 
>>> Thanks,
>>> 
>>> Erwin
>>> 
>>> 
>>> 
>>> -- 
>>> -- 
>>> Christian Schneider
>>> http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>> 
>>> Open Source Architect
>>> http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>> 
>> 
>> 
>> -- 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>> 
>> Open Source Architect
>> http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
> 
> 
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
> 
> Open Source Architect
> http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Christian Schneider <ch...@die-schneider.net>.
I think the mysql driver indeed registers the DSF. You might need to
provide the bundle for the DataSourceFactory api though. Can you try that?

Christian

2017-01-06 18:18 GMT+01:00 Erwin Hogeweg <er...@me.com>:

> Thanks,
>
> I can see the reasoning. That is confusing though. I thought that the
> MySQL driver now registered the DSF, just like the h2 bundle, so I removed
> the pax-jdbc bundles... after which the MySQL bundle did NOT 'register' the
> DSF anymore :-)
>
> Erwin
>
> El ene. 6, 2017, a las 10:30, Christian Schneider <ch...@die-schneider.net>
> escribió:
>
> I think the behaviour of pax-jdbc is correct. It should register the DSF
> in the name of the jdbc provider bundle.
>
> Christian
>
> 2017-01-06 13:52 GMT+01:00 Erwin Hogeweg <er...@me.com>:
>
>> Christian,
>>
>> On Jan 6, 2017, at 2:22 AM, Christian Schneider <ch...@die-schneider.net>
>> wrote:
>>
>> That might be a bug. I think jpa container should register
>> both EntityManagerFactoryBuilder and EntityManagerFactory in the name of
>> the persistence bundle.
>> Can you open an issue for this?
>>
>> Sure: https://issues.apache.org/jira/browse/ARIES-1652
>>
>> Do you want me to open a separate one for the pax-jdbc-config bundle? I
>> believe that bundle has the same author(s)…
>>
>> Erwin
>>
>> Christian
>>
>> 2017-01-05 14:31 GMT+01:00 Erwin Hogeweg <er...@me.com>:
>>
>>> Hi,
>>>
>>> I am seeing a strange (wildly confusing) service registration when using
>>> the Aries JPA Container with Equinox. Not sure where the problem is, so I
>>> figured I start here.
>>>
>>> When the DataSource and the PersistenceProvider are available the
>>> container registers the EntityMangerFactory* services. However, the
>>> EntityManagerFactoryBuilder Service shows up as being registered by the
>>> container bundle while the EntityMangerFactory Services shows up as being
>>> registered by the bundle that provides the persistence unit.
>>>
>>> g! b 53
>>> org.apache.aries.jpa.container_2.3.0 [53]
>>>   Id=53, Status=ACTIVE      Data Root=...
>>>  * "Registered Services"*
>>>     {org.osgi.framework.hooks.weaving.WeavingHook}=...
>>>     {org.osgi.service.cm.ManagedService}=...
>>>     *{org.osgi.service.jpa.EntityManagerFactoryBuilder}*={osgi.uni
>>> t.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu,
>>> osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider,
>>> service.id=119, *service.bundleid=53*, service.scope=singleton}
>>>   Services in use:
>>>     {javax.sql.DataSource}=...
>>>     {javax.persistence.spi.PersistenceProvider}=...
>>>
>>> g! b 111
>>> com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>>>   Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.ecli
>>> pse.osgi/111/data
>>>  * "Registered Services"*
>>> *    {javax.persistence.EntityManagerFactory}*={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222,
>>> osgi.unit.name=my.pu, osgi.unit.provider=org.eclipse
>>> .persistence.jpa.PersistenceProvider, service.id=125,
>>> *service.bundleid=111*, service.scope=singleton}
>>>   No services in use.
>>>
>>> This is with equinox 3.10.2.v20150203-1939, J8.
>>>
>>> BTW, I see the same thing happening with the mysql and the
>>> pax-jdbc-config bundles. The DataSourceFactory service shows as being
>>> registered by the mysql bundle, while it is actually registered by the
>>> config bundle.
>>>
>>> What am I missing here? Is this a feature, a bug, or is my brain not
>>> flexible enough to comprehend this?
>>>
>>>
>>> Thanks,
>>>
>>> Erwin
>>>
>>
>>
>>
>> --
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>
>> Open Source Architect
>> http://www.talend.com
>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>>
>>
>>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> Open Source Architect
> http://www.talend.com
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>
>


-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Erwin Hogeweg <er...@me.com>.
Thanks,

I can see the reasoning. That is confusing though. I thought that the MySQL driver now registered the DSF, just like the h2 bundle, so I removed the pax-jdbc bundles... after which the MySQL bundle did NOT 'register' the DSF anymore :-)

Erwin
 
> El ene. 6, 2017, a las 10:30, Christian Schneider <ch...@die-schneider.net> escribió:
> 
> I think the behaviour of pax-jdbc is correct. It should register the DSF in the name of the jdbc provider bundle.
> 
> Christian
> 
> 2017-01-06 13:52 GMT+01:00 Erwin Hogeweg <er...@me.com>:
>> Christian,
>> 
>>> On Jan 6, 2017, at 2:22 AM, Christian Schneider <ch...@die-schneider.net> wrote:
>>> 
>>> That might be a bug. I think jpa container should register both EntityManagerFactoryBuilder and EntityManagerFactory in the name of the persistence bundle.
>>> Can you open an issue for this?
>>> 
>> Sure: https://issues.apache.org/jira/browse/ARIES-1652
>> 
>> Do you want me to open a separate one for the pax-jdbc-config bundle? I believe that bundle has the same author(s)…
>> 
>> Erwin
>>> Christian
>>> 
>>> 2017-01-05 14:31 GMT+01:00 Erwin Hogeweg <er...@me.com>:
>>>> Hi,
>>>> 
>>>> I am seeing a strange (wildly confusing) service registration when using the Aries JPA Container with Equinox. Not sure where the problem is, so I figured I start here.
>>>> 
>>>> When the DataSource and the PersistenceProvider are available the container registers the EntityMangerFactory* services. However, the EntityManagerFactoryBuilder Service shows up as being registered by the container bundle while the EntityMangerFactory Services shows up as being registered by the bundle that provides the persistence unit.
>>>> 
>>>> g! b 53
>>>> org.apache.aries.jpa.container_2.3.0 [53]
>>>>   Id=53, Status=ACTIVE      Data Root=...
>>>>   "Registered Services"
>>>>     {org.osgi.framework.hooks.weaving.WeavingHook}=...
>>>>     {org.osgi.service.cm.ManagedService}=...
>>>>     {org.osgi.service.jpa.EntityManagerFactoryBuilder}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=119, service.bundleid=53, service.scope=singleton}
>>>>   Services in use:
>>>>     {javax.sql.DataSource}=...
>>>>     {javax.persistence.spi.PersistenceProvider}=...
>>>> 
>>>> g! b 111
>>>> com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>>>>   Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.eclipse.osgi/111/data
>>>>   "Registered Services"
>>>>     {javax.persistence.EntityManagerFactory}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=125, service.bundleid=111, service.scope=singleton}
>>>>   No services in use.
>>>> 
>>>> This is with equinox 3.10.2.v20150203-1939, J8.
>>>> 
>>>> BTW, I see the same thing happening with the mysql and the pax-jdbc-config bundles. The DataSourceFactory service shows as being registered by the mysql bundle, while it is actually registered by the config bundle.
>>>> 
>>>> What am I missing here? Is this a feature, a bug, or is my brain not flexible enough to comprehend this? 
>>>> 
>>>> 
>>>> Thanks,
>>>> 
>>>> Erwin
>>> 
>>> 
>>> 
>>> -- 
>>> -- 
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>> 
>>> Open Source Architect
>>> http://www.talend.com
>> 
> 
> 
> 
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Open Source Architect
> http://www.talend.com

Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Christian Schneider <ch...@die-schneider.net>.
I think the behaviour of pax-jdbc is correct. It should register the DSF in
the name of the jdbc provider bundle.

Christian

2017-01-06 13:52 GMT+01:00 Erwin Hogeweg <er...@me.com>:

> Christian,
>
> On Jan 6, 2017, at 2:22 AM, Christian Schneider <ch...@die-schneider.net>
> wrote:
>
> That might be a bug. I think jpa container should register both EntityManagerFactoryBuilder
> and EntityManagerFactory in the name of the persistence bundle.
> Can you open an issue for this?
>
> Sure: https://issues.apache.org/jira/browse/ARIES-1652
>
> Do you want me to open a separate one for the pax-jdbc-config bundle? I
> believe that bundle has the same author(s)…
>
> Erwin
>
> Christian
>
> 2017-01-05 14:31 GMT+01:00 Erwin Hogeweg <er...@me.com>:
>
>> Hi,
>>
>> I am seeing a strange (wildly confusing) service registration when using
>> the Aries JPA Container with Equinox. Not sure where the problem is, so I
>> figured I start here.
>>
>> When the DataSource and the PersistenceProvider are available the
>> container registers the EntityMangerFactory* services. However, the
>> EntityManagerFactoryBuilder Service shows up as being registered by the
>> container bundle while the EntityMangerFactory Services shows up as being
>> registered by the bundle that provides the persistence unit.
>>
>> g! b 53
>> org.apache.aries.jpa.container_2.3.0 [53]
>>   Id=53, Status=ACTIVE      Data Root=...
>>  * "Registered Services"*
>>     {org.osgi.framework.hooks.weaving.WeavingHook}=...
>>     {org.osgi.service.cm.ManagedService}=...
>>     *{org.osgi.service.jpa.EntityManagerFactoryBuilder}*={osgi.
>> unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu,
>> osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider,
>> service.id=119, *service.bundleid=53*, service.scope=singleton}
>>   Services in use:
>>     {javax.sql.DataSource}=...
>>     {javax.persistence.spi.PersistenceProvider}=...
>>
>> g! b 111
>> com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>>   Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.ecli
>> pse.osgi/111/data
>>  * "Registered Services"*
>> *    {javax.persistence.EntityManagerFactory}*={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222,
>> osgi.unit.name=my.pu, osgi.unit.provider=org.eclipse
>> .persistence.jpa.PersistenceProvider, service.id=125,
>> *service.bundleid=111*, service.scope=singleton}
>>   No services in use.
>>
>> This is with equinox 3.10.2.v20150203-1939, J8.
>>
>> BTW, I see the same thing happening with the mysql and the
>> pax-jdbc-config bundles. The DataSourceFactory service shows as being
>> registered by the mysql bundle, while it is actually registered by the
>> config bundle.
>>
>> What am I missing here? Is this a feature, a bug, or is my brain not
>> flexible enough to comprehend this?
>>
>>
>> Thanks,
>>
>> Erwin
>>
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> Open Source Architect
> http://www.talend.com
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>
>
>


-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Erwin Hogeweg <er...@me.com>.
Christian,

> On Jan 6, 2017, at 2:22 AM, Christian Schneider <ch...@die-schneider.net> wrote:
> 
> That might be a bug. I think jpa container should register both EntityManagerFactoryBuilder and EntityManagerFactory in the name of the persistence bundle.
> Can you open an issue for this?
> 
Sure: https://issues.apache.org/jira/browse/ARIES-1652 <https://issues.apache.org/jira/browse/ARIES-1652>

Do you want me to open a separate one for the pax-jdbc-config bundle? I believe that bundle has the same author(s)…

Erwin
> Christian
> 
> 2017-01-05 14:31 GMT+01:00 Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>>:
> Hi,
> 
> I am seeing a strange (wildly confusing) service registration when using the Aries JPA Container with Equinox. Not sure where the problem is, so I figured I start here.
> 
> When the DataSource and the PersistenceProvider are available the container registers the EntityMangerFactory* services. However, the EntityManagerFactoryBuilder Service shows up as being registered by the container bundle while the EntityMangerFactory Services shows up as being registered by the bundle that provides the persistence unit.
> 
> g! b 53
> org.apache.aries.jpa.container_2.3.0 [53]
>   Id=53, Status=ACTIVE      Data Root=...
>   "Registered Services"
>     {org.osgi.framework.hooks.weaving.WeavingHook}=...
>     {org.osgi.service.cm <http://org.osgi.service.cm/>.ManagedService}=...
>     {org.osgi.service.jpa.EntityManagerFactoryBuilder}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name <http://osgi.unit.name/>=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id <http://service.id/>=119, service.bundleid=53, service.scope=singleton}
>   Services in use:
>     {javax.sql.DataSource}=...
>     {javax.persistence.spi.PersistenceProvider}=...
> 
> g! b 111
> com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>   Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.eclipse.osgi/111/data
>   "Registered Services"
>     {javax.persistence.EntityManagerFactory}={osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name <http://osgi.unit.name/>=my.pu, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id <http://service.id/>=125, service.bundleid=111, service.scope=singleton}
>   No services in use.
> 
> This is with equinox 3.10.2.v20150203-1939, J8.
> 
> BTW, I see the same thing happening with the mysql and the pax-jdbc-config bundles. The DataSourceFactory service shows as being registered by the mysql bundle, while it is actually registered by the config bundle.
> 
> What am I missing here? Is this a feature, a bug, or is my brain not flexible enough to comprehend this? 
> 
> 
> Thanks,
> 
> Erwin
> 
> 
> 
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
> 
> Open Source Architect
> http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: JPA Container - Unexpected EntityManagerFactory Service Registration

Posted by Christian Schneider <ch...@die-schneider.net>.
That might be a bug. I think jpa container should register
both EntityManagerFactoryBuilder and EntityManagerFactory in the name of
the persistence bundle.
Can you open an issue for this?

Christian

2017-01-05 14:31 GMT+01:00 Erwin Hogeweg <er...@me.com>:

> Hi,
>
> I am seeing a strange (wildly confusing) service registration when using
> the Aries JPA Container with Equinox. Not sure where the problem is, so I
> figured I start here.
>
> When the DataSource and the PersistenceProvider are available the
> container registers the EntityMangerFactory* services. However, the
> EntityManagerFactoryBuilder Service shows up as being registered by the
> container bundle while the EntityMangerFactory Services shows up as being
> registered by the bundle that provides the persistence unit.
>
> g! b 53
> org.apache.aries.jpa.container_2.3.0 [53]
>   Id=53, Status=ACTIVE      Data Root=...
>  * "Registered Services"*
>     {org.osgi.framework.hooks.weaving.WeavingHook}=...
>     {org.osgi.service.cm.ManagedService}=...
>     *{org.osgi.service.jpa.EntityManagerFactoryBuilder}*={
> osgi.unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu,
> osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider,
> service.id=119, *service.bundleid=53*, service.scope=singleton}
>   Services in use:
>     {javax.sql.DataSource}=...
>     {javax.persistence.spi.PersistenceProvider}=...
>
> g! b 111
> com.my.model_4.1.0.SNAPSHOT_20170104-2222 [111]
>   Id=111, Status=ACTIVE      Data Root=/Users/erwin/.../org.
> eclipse.osgi/111/data
>  * "Registered Services"*
> *    {javax.persistence.EntityManagerFactory}*={osgi.
> unit.version=4.1.0.SNAPSHOT_20170104-2222, osgi.unit.name=my.pu,
> osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider,
> service.id=125, *service.bundleid=111*, service.scope=singleton}
>   No services in use.
>
> This is with equinox 3.10.2.v20150203-1939, J8.
>
> BTW, I see the same thing happening with the mysql and the pax-jdbc-config
> bundles. The DataSourceFactory service shows as being registered by the
> mysql bundle, while it is actually registered by the config bundle.
>
> What am I missing here? Is this a feature, a bug, or is my brain not
> flexible enough to comprehend this?
>
>
> Thanks,
>
> Erwin
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>