Hi,

The “tricky” part comes from the fact that the EntityManager Service API isn’t 
coupled to any of your domain classes, meaning that your “client” bundles can 
see EntityManager services registered by all of the persistence units, not just 
the one that they are wired to by Import-Package. Typically this will end up 
with with all the clients using the “first” service that they find, and some of 
them breaking with ClassCastException.

My advice would be to structure your code with the domain classes living inside 
a data access bundle (i.e. one which publishes a specific data access service). 
That way you can restrict the data access bundle to use the EntityManager that 
it provides, and you can rely on the service registry/uses constraints to fix 
the service visibility problem for you 100% of the time.


Best Regards,

Tim

> On 27 Dec 2019, at 14:18, tvogel <tvo...@msn.com> wrote:
> 
> JB,
>  I'm using Aries feature in 4.0.10.  
> 
>  Does "tricky" mean the changes are not obvious or it takes experimentation
> on my specific setup to get working?
> 
> Thanks,
> Timothy 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply via email to