karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (KARAF-3034) Automatically create data sources from configuration files
Date Fri, 04 Jul 2014 09:47:34 GMT

     [ https://issues.apache.org/jira/browse/KARAF-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Christian Schneider resolved KARAF-3034.

    Resolution: Won't Fix

Will implement this in pax-jdbc as the implementation does not depend on karaf. So we can
just reuse it.


> Automatically create data sources from configuration files
> ----------------------------------------------------------
>                 Key: KARAF-3034
>                 URL: https://issues.apache.org/jira/browse/KARAF-3034
>             Project: Karaf
>          Issue Type: New Feature
>    Affects Versions: 3.0.1
>            Reporter: Christian Schneider
>            Assignee: Christian Schneider
>             Fix For: 4.0.0, 3.0.2, 2.3.6
> We already support creation of data sources using the jdbc:create command. There we create
a blueprint file in the deploy folder.
> This has some drawbacks though:
> 1. It requires blueprint which is bad for karaf 4
> 2. The deploy folder often creates race conditions so it is rather not good for production
> 3. The create command needs to support each database type and the configs in the resulting
blueprint can not be changed using config admin
> So what I have in mind is to create a module that watches for configs in config admin
that match a certain filter like org.apache.karaf.datasource.*.cfg or even datasource.*.cfg.
> Each such config contains properties defined in DataSourceFactory like url, user, password,
> The DataSourceFactory is chosen by a driver property.
> So such a config (datasource.test.cfg) could look like this for derby:
> driver=org.apache.derby.jdbc.EmbeddedDriver
> databaseName=memory:TEST;create=true
> So the new module would do the following:
> - pick up the config
> - find the matching DataSourceFactory (e.g. provided by pax jdbc)
> - create a new DataSource with the rest of the properties
> - publish the DataSource as an OSGi service and with a jndi name suitable for aries jndi
> So the user would install:
> - derby
> - pax jdbc derby
> - the new module
> - config in etc
> The result would be a data source that is ready to use for aries jdbc or any other use
> This solution would work much better for production deployments than the current blueprint
> We could then adapt the jdbc:create command to work on the config files to make it even
easier to create data sources than with pure configs.

This message was sent by Atlassian JIRA

View raw message