This blog post describes the way I switch between different database
systems (in my case: switch between derby and PostgreSQL) in apache
karaf:
https://steinar.bang.priv.no/2019/10/26/pluggable-databases-for-apache-karaf-applications/
What I do, is:
1. Create an application specific DatabaseService interface
2. Inject the application specific DatabaseService into the business
logic DS component
3. Create an OSGi bundle defining a liquibase schema
4. Create a DS component providing the DatabaseService that starts
derby in-memory database and install the liquibase schema
5. Create a DS component providing the DatabaseService that connects to
PostgreSQL and install the liquibase schema
6. Create different karaf features that
1. load the application with the derby DS component
2. load the application with the PostgreSQL component
More detail and examples in the blog post.
Hi
Thanks for sharing, I will take a look.
The purpose is to have a service layer ? What's the difference with pax-jdbc and karaf JDBC feature ?
Regards
JB
Le 26 oct. 2019 13:21, Steinar Bang <[email protected]> a écrit :
- Pluggable databases in apache karaf Steinar Bang
- Re: Pluggable databases in apache karaf jb
- Re: Pluggable databases in apache karaf Steinar Bang
- Re: Pluggable databases in apache karaf Jean-Baptiste Onofré
- Re: Pluggable databases in apache k... Steinar Bang
- Re: Pluggable databases in apa... jb
- Re: Pluggable databases in... Steinar Bang
- Re: Pluggable database... Steinar Bang
- Re: Pluggable database... Jean-Baptiste Onofré
- Re: Pluggable database... Steinar Bang
- Using pax-jdbc-config ... Steinar Bang
- Re: Pluggable databases in apache karaf Christian Schneider
