I am not sure if you can have property place holders (wired with config admin) 
inside persistence.xml. At least I have not seen such example so far.
If when you switch customers, environments etc, the only thing that changes is 
the datasource, I think that you can expose the datasource as an osgi service 
using a managed service and then reuse the datasource in your persitence.xml 
via jndi (with aries jndi).
This way you can dynamically change your datasource service instead.

On 17 Ιαν 2012, at 11:57 μ.μ., lbu wrote:

> Hi all,
> I'm new to OSGi and in particular to "OSGi 4 enterprise" and I'm looking for
> the best way to configure JPA for different environments/customers/etc
> without having to change my JPA bundle.
> 
> My first thought was to override the properties in persistence.xml via
> ConfiAdmin but I have not found any reference on this topic, should it be
> possible ? 
> 
> If not is there any other option to achieve what I'm looking for ?
> 
> Regards,
> Luca
> 
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Karaf-JPA-and-ConfigAdmin-tp3667564p3667564.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Ioannis Canellos
FuseSource

Blog: http://iocanel.blogspot.com
Apache Karaf Committer & PMC
Apache Camel Committer
Apache ServiceMix  Committer
Apache Gora Committer
Apache DirectMemory Committer

Reply via email to