Change in Pax-JDBC configuration file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Change in Pax-JDBC configuration file

dsjaxen

Hi!

I am attempting to upgrade to karaf 4.2.8. We are using pax-jdbc configuration files.

When I added the pax-jdbc feature and a org.ops4j.datasource-xxx.cfg to the etc directory, it did not work as it used to. I messed around with it some, and found that I had to change the name of the driver. The data source factory for the H2 driver was showing a service name of “H2 JDBC Driver”.  My cfg file previously contained:

 

osgi.jdbc.driver.name=H2

 

That no longer works. I have to change that to:

 

osgi.jdbc.driver.name = H2 JDBC Driver

 

Are others aware of this?  Was this intentional?

Thanks,

Doug

 

 

karaf@TcIF()> service:list org.osgi.service.jdbc.DataSourceFactory

[org.osgi.service.jdbc.DataSourceFactory]

-----------------------------------------

osgi.jdbc.driver.class = org.h2.Driver

osgi.jdbc.driver.name = H2 JDBC Driver

osgi.jdbc.driver.version = 1.4.199 (2019-03-13)

service.bundleid = 12

service.id = 191

service.scope = singleton

Provided by :

H2 Database Engine (12)

 

k

Reply | Threaded
Open this post in threaded view
|

Re: Change in Pax-JDBC configuration file

Tim Ward-2
Hi,

I’m not a PAX expert, but the osgi.jdbc.driver.name property from the OSGi JDBC service specification is supposed to be a human readable name for the driver, and could easily change between versions/packagings. If you want something to use as an identifier to find a particular DataSourceFactory then the osgi.jdbc.driver.class property would be a better choice because it identifies the driver class name, which is documented external API and not subject to change. 

Tim

Sent from my iPhone

On 19 Feb 2020, at 15:04, Jackson, Douglas <[hidden email]> wrote:

Hi!

I am attempting to upgrade to karaf 4.2.8. We are using pax-jdbc configuration files.

When I added the pax-jdbc feature and a org.ops4j.datasource-xxx.cfg to the etc directory, it did not work as it used to. I messed around with it some, and found that I had to change the name of the driver. The data source factory for the H2 driver was showing a service name of “H2 JDBC Driver”.  My cfg file previously contained:

 

osgi.jdbc.driver.name=H2

 

That no longer works. I have to change that to:

 

osgi.jdbc.driver.name = H2 JDBC Driver

 

Are others aware of this?  Was this intentional?

Thanks,

Doug

 

 

karaf@TcIF()> service:list org.osgi.service.jdbc.DataSourceFactory

[org.osgi.service.jdbc.DataSourceFactory]

-----------------------------------------

osgi.jdbc.driver.class = org.h2.Driver

osgi.jdbc.driver.name = H2 JDBC Driver

osgi.jdbc.driver.version = 1.4.199 (2019-03-13)

service.bundleid = 12

service.id = 191

service.scope = singleton

Provided by :

H2 Database Engine (12)

 

k

Reply | Threaded
Open this post in threaded view
|

RE: Change in Pax-JDBC configuration file

dsjaxen
In reply to this post by dsjaxen

Hi!

I was not aware that the class would work. All the examples I ever saw used the name.

I did try it with the osgi.jdbc.driver.class and it works. Driver class names can change too unfortunately (package names and what not). I recall different oracle drivers over the years.

Probably thousands of dollars of work for us :(

One option I am considering is changing the name back to “H2” – does anyone see any potential problems with that?  (It would be considerably less work)

-Doug

 

From: Jackson, Douglas (DI SW LCS CF CLP DEX)
Sent: Wednesday, February 19, 2020 9:05 AM
To: '[hidden email]' <[hidden email]>
Subject: Change in Pax-JDBC configuration file

 

Hi!

I am attempting to upgrade to karaf 4.2.8. We are using pax-jdbc configuration files.

When I added the pax-jdbc feature and a org.ops4j.datasource-xxx.cfg to the etc directory, it did not work as it used to. I messed around with it some, and found that I had to change the name of the driver. The data source factory for the H2 driver was showing a service name of “H2 JDBC Driver”.  My cfg file previously contained:

 

osgi.jdbc.driver.name=H2

 

That no longer works. I have to change that to:

 

osgi.jdbc.driver.name = H2 JDBC Driver

 

Are others aware of this?  Was this intentional?

Thanks,

Doug

 

 

karaf@TcIF()> service:list org.osgi.service.jdbc.DataSourceFactory

[org.osgi.service.jdbc.DataSourceFactory]

-----------------------------------------

osgi.jdbc.driver.class = org.h2.Driver

osgi.jdbc.driver.name = H2 JDBC Driver

osgi.jdbc.driver.version = 1.4.199 (2019-03-13)

service.bundleid = 12

service.id = 191

service.scope = singleton

Provided by :

H2 Database Engine (12)

 

k