Hi,

I just did a blog where I'm using a derby datasource (on Karaf
4.2.3-SNAPSHOT): http://blog.nanthrax.net/?p=874

If you install an unique provider (only derby or derbyclient, but not
both), then, it should work.

I did:

feature:install pax-jdbc-derbyclient

then:

jdbc:ds-create -dn derbyclient -url jdbc:derby://localhost:1527/foo foo

And I see only one datasource service:

karaf@root()> jdbc:ds-list
Name      │ Service Id │ Product      │ Version               │ URL
                              │ Status
────┼────────────┼──────────────┼───────────────────────┼───────────────────────────────────────┼───────
foo │ 91         │ Apache Derby │ 10.14.2.0 - (1828579) │
jdbc:derby://localhost:1527/scheduler │ OK

In your case, it seems that pax-jdbc-config is in cause, like it
bootstrap two db.  How to do you provision the datasource cfg file ?
Using a feature or by dropping the file in the etc folder ?

I will check when my build is complete.

Regards
JB

On 01/02/2019 18:48, Alex Soto wrote:
> Hello,
> 
> I am experiencing a problem where /pax-jdbc-config/ (version 1.3.0) is
> creating duplicate Derby Data Sources.  I copy the data source
> configuration file to  Karaf's /etc/ /directory, after a while I can see
> it created two identical Data Sources.
> 
> The configuration file: /org.ops4j.datasource-querier.cfg/
> 
>     osgi.jdbc.driver.name = derby
>     dataSourceName=querier
>     url=jdbc:derby:derby-data/querier;create=true
> 
>     user=enquery
>     password=XXXX
>     databaseName=querier
> 
>     ops4j.preHook=querierDB
> 
> 
> It creates duplicate Data Sources:
> 
>     karaf@root()> service:list DataSource                              
>                                                                        
>                                                                        
>                    
>     [javax.sql.DataSource]
>     ----------------------
>      databaseName = querier
>      dataSourceName = querier
>      felix.fileinstall.filename =
>     file:/Users/asoto/test/etc/org.ops4j.datasource-querier.cfg
>      ops4j.preHook = querierDB
>      osgi.jdbc.driver.name = derby
>      osgi.jndi.service.name = querier
>      password = enquery
>      pax.jdbc.managed = true
>      service.bundleid = 169
>      service.factoryPid = org.ops4j.datasource
>      service.id <http://service.id> = 238
>      service.pid = org.ops4j.datasource.b161e768-e5f8-40bb-b19f-40cab9111316
>      service.scope = singleton
>      url = jdbc:derby:derby-data/querier;create=true
>      user = enquery
>     Provided by : 
>      OPS4J Pax JDBC Config (169)
>     Used by: 
>      JPA (22)
>     [javax.sql.DataSource]
>     ----------------------
>      databaseName = querier
>      dataSourceName = querier
>      felix.fileinstall.filename
>     = file:/Users/asoto/test/etc/org.ops4j.datasource-querier.cfg
>      ops4j.preHook = querierDB
>      osgi.jdbc.driver.name = derby
>      osgi.jndi.service.name = querier
>      password = enquery
>      pax.jdbc.managed = true
>      service.bundleid = 169
>      service.factoryPid = org.ops4j.datasource
>      service.id <http://service.id> = 282
>      service.pid = org.ops4j.datasource.b161e768-e5f8-40bb-b19f-40cab9111316
>      service.scope = singleton
>      url = jdbc:derby:derby-data/querier;create=true
>      user = enquery
>     Provided by : 
>      OPS4J Pax JDBC Config (169)
> 
> 
> Also:
> 
>     karaf@root()> jdbc:ds-list
>     Name    │ Product      │ Version               │ URL                
>               │ Status
>     
> ────────┼──────────────┼───────────────────────┼───────────────────────────────┼───────
>     querier │ Apache Derby │ 10.13.1.1 - (1765088) │
>     jdbc:derby:derby-data/querier │ OK
>     querier │ Apache Derby │ 10.13.1.1 - (1765088) │
>     jdbc:derby:derby-data/querier │ OK
> 
> 
> 
> I think it must be specific to Derby, as the same works fine if the
> driver is MariaDB.
> Any clues?
> 
> Best regards,
> Alex soto
> 
> 
> 
> 

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to