Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

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

Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

Erwin Hogeweg
All -

Is anyone aware of changes in the DB pool configuration parameters in 4.2.1? I can’t find any documentation re. that.

The error I received in 4.2.0 is gone, but I can’t figure out how to configure the pool. I tried all possible combination of pool. factory. and property but none seem to work.

Any pointer to an example or a document would be very much appreciated.

FWIW, This is my datasource .cfg

osgi.jdbc.driver.class=com.mysql.jdbc.Driver
url=jdbc:<a href="mysql://my_db_server:3306/" class="">mysql://my_db_server:3306/xyz?useSSL=false
dataSourceName=jdbc/xyz
user=user
password=password
pool=dbcp2
xa=false

pool.maxTotal=8
pool.maxIdle=25

And these are the generated services:

karaf@root()> service:list DataSource                                                                                                                                      
[javax.sql.DataSource]
----------------------
 dataSourceName = jdbc/xyz
 felix.fileinstall.filename = file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
 osgi.jdbc.driver.class = com.mysql.jdbc.Driver
 osgi.jndi.service.name = jdbc/xyz
 password = password
 pax.jdbc.managed = true
 pool.maxIdle = 25
 pool.maxTotal = 8
 service.bundleid = 16
 service.factoryPid = org.ops4j.datasource
 service.id = 274
 service.pid = org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
 service.scope = singleton
 url = jdbc:<a href="mysql://my_db_server:3306/xyz?useSSL=false" class="">mysql://my_db_server:3306/xyz?useSSL=false
 user = user
Provided by : 
 OPS4J Pax JDBC Config (16)
Used by: 
 Xyz :: Data Model (190)
 Xyz :: Repository Services Impl. (200)

karaf@root()> service:list PooledDataSourceFactory
[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id = 113
 service.scope = singleton
 xa = false
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)
Used by: 
 OPS4J Pax JDBC Config (16)

[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id = 116
 service.scope = singleton
 xa = true
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)

karaf@root()>                                                                                                                                                                                 
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

jbonofre
Hi,

The pool uses "pool." prefix in the config.

So pool.maxTotal is a valid configuration in DBCP, pool.dummy is another
one.

You can use any DBCP configuration as soon as you prefix with "pool.":

maxIdle
maxTotal
maxWaitMillis
testOnBorrow
validationQuery
validationQueryTimeout

Regards
JB

On 10/09/2018 14:10, Erwin Hogeweg wrote:

> All -
>
> Is anyone aware of changes in the DB pool configuration parameters in
> 4.2.1? I can’t find any documentation re. that.
>
> The error I received in 4.2.0 is gone, but I can’t figure out how to
> configure the pool. I tried all possible combination of pool. factory.
> and property but none seem to work.
>
> Any pointer to an example or a document would be very much appreciated.
>
> FWIW, This is my datasource .cfg
>
> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
> dataSourceName=jdbc/_xyz_
> user=_user_
> password=_password_
> pool=dbcp2
> xa=false
>
> pool.maxTotal=8
> pool.maxIdle=25
>
> And these are the generated services:
>
> *karaf*@root()> service:listDataSource                                  
>                                                                        
>                            
> [javax.sql.DataSource]
> ----------------------
>  dataSourceName = jdbc/xyz
>  felix.fileinstall.filename =
> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>  osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>  osgi.jndi.service.name = jdbc/xyz
>  password = password
>  pax.jdbc.managed = true
>  pool.maxIdle = 25
>  pool.maxTotal = 8
>  service.bundleid = 16
>  service.factoryPid = org.ops4j.datasource
>  service.id <http://service.id/> = 274
>  service.pid = org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>  service.scope = singleton
>  url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>  user = user
> Provided by : 
>  OPS4J Pax JDBC Config (16)
> Used by: 
>  Xyz :: Data Model (190)
>  Xyz :: Repository Services Impl. (200)
>
> *karaf*@root()> service:listPooledDataSourceFactory
> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
> --------------------------------------------------------
>  pool = dbcp2
>  service.bundleid = 86
>  service.id <http://service.id/> = 113
>  service.scope = singleton
>  xa = false
> Provided by : 
>  OPS4J Pax JDBC Pooling DBCP2 (86)
> Used by: 
>  OPS4J Pax JDBC Config (16)
>
> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
> --------------------------------------------------------
>  pool = dbcp2
>  service.bundleid = 86
>  service.id <http://service.id/> = 116
>  service.scope = singleton
>  xa = true
> Provided by : 
>  OPS4J Pax JDBC Pooling DBCP2 (86)
>
> *karaf*@root()>                                                         
>                                                                        
>                                                

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

Erwin Hogeweg
Thanks JB,

The pool uses "pool." prefix in the config.

So pool.maxTotal is a valid configuration in DBCP, pool.dummy is another one.
That is what I thought, but those properties don’t show up in the PooledDataSourceFactory (see below). Is that expected?

Thanks,

Erwin


[javax.sql.DataSource]
———————————

pool.maxIdle = 25
 pool.maxTotal = 8


[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id/> = 113
 service.scope = singleton
 xa = false
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)
Used by: 
 OPS4J Pax JDBC Config (16)

[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id/> = 116
 service.scope = singleton
 xa = true
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)




You can use any DBCP configuration as soon as you prefix with "pool.":

maxIdle
maxTotal
maxWaitMillis
testOnBorrow
validationQuery
validationQueryTimeout

Regards
JB

On 10/09/2018 14:10, Erwin Hogeweg wrote:
All -

Is anyone aware of changes in the DB pool configuration parameters in
4.2.1? I can’t find any documentation re. that.

The error I received in 4.2.0 is gone, but I can’t figure out how to
configure the pool. I tried all possible combination of pool. factory.
and property but none seem to work.

Any pointer to an example or a document would be very much appreciated.

FWIW, This is my datasource .cfg

osgi.jdbc.driver.class=com.mysql.jdbc.Driver
url=jdbc:<a href="mysql://my_db_server:3306/xyz?useSSL=false" class="">mysql://my_db_server:3306/xyz?useSSL=false
dataSourceName=jdbc/_xyz_
user=_user_
password=_password_
pool=dbcp2
xa=false

pool.maxTotal=8
pool.maxIdle=25

And these are the generated services:

*karaf*@root()> service:listDataSource                                  
                                                                       
                           
[javax.sql.DataSource]
----------------------
 dataSourceName = jdbc/xyz
 felix.fileinstall.filename =
file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
 osgi.jdbc.driver.class = com.mysql.jdbc.Driver
 osgi.jndi.service.name = jdbc/xyz
 password = password
 pax.jdbc.managed = true
 pool.maxIdle = 25
 pool.maxTotal = 8
 service.bundleid = 16
 service.factoryPid = org.ops4j.datasource
 service.id <http://service.id/> = 274
 service.pid = org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
 service.scope = singleton
 url = jdbc:<a href="mysql://my_db_server:3306/xyz?useSSL=false" class="">mysql://my_db_server:3306/xyz?useSSL=false
 user = user
Provided by : 
 OPS4J Pax JDBC Config (16)
Used by: 
 Xyz :: Data Model (190)
 Xyz :: Repository Services Impl. (200)

*karaf*@root()> service:listPooledDataSourceFactory
[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id/> = 113
 service.scope = singleton
 xa = false
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)
Used by: 
 OPS4J Pax JDBC Config (16)

[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id/> = 116
 service.scope = singleton
 xa = true
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)

*karaf*@root()>                                                         
                                                                       
                                               

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

Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

jbonofre
What's the output of bundle:services -p 86 ?

All pool properties are not as service properties, they are only config
properties.

Regards
JB

On 10/09/2018 15:23, Erwin Hogeweg wrote:

> Thanks JB,
>
>> The pool uses "pool." prefix in the config.
>>
>> So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
>> another one.
> That is what I thought, but those properties don’t show up in the
> PooledDataSourceFactory (see below). Is that expected?
>
> Thanks,
>
> Erwin
>
>
>>> [javax.sql.DataSource]
>>> ———————————
>>> …
>
>>> *pool.maxIdle = 25
>>>  pool.maxTotal = 8
>>> *
>
>
>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>> --------------------------------------------------------
>>>  pool = dbcp2
>>>  service.bundleid = 86
>>>  service.id <http://service.id> <http://service.id/> = 113
>>>  service.scope = singleton
>>>  xa = false
>>> Provided by : 
>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>> Used by: 
>>>  OPS4J Pax JDBC Config (16)
>>>
>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>> --------------------------------------------------------
>>>  pool = dbcp2
>>>  service.bundleid = 86
>>>  service.id <http://service.id> <http://service.id/> = 116
>>>  service.scope = singleton
>>>  xa = true
>>> Provided by : 
>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>
>
>
>>
>> You can use any DBCP configuration as soon as you prefix with "pool.":
>>
>> maxIdle
>> maxTotal
>> maxWaitMillis
>> testOnBorrow
>> validationQuery
>> validationQueryTimeout
>>
>> Regards
>> JB
>>
>> On 10/09/2018 14:10, Erwin Hogeweg wrote:
>>> All -
>>>
>>> Is anyone aware of changes in the DB pool configuration parameters in
>>> 4.2.1? I can’t find any documentation re. that.
>>>
>>> The error I received in 4.2.0 is gone, but I can’t figure out how to
>>> configure the pool. I tried all possible combination of pool. factory.
>>> and property but none seem to work.
>>>
>>> Any pointer to an example or a document would be very much appreciated.
>>>
>>> FWIW, This is my datasource .cfg
>>>
>>> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
>>> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>> dataSourceName=jdbc/_xyz_
>>> user=_user_
>>> password=_password_
>>> pool=dbcp2
>>> xa=false
>>>
>>> pool.maxTotal=8
>>> pool.maxIdle=25
>>>
>>> And these are the generated services:
>>>
>>> *karaf*@root()> service:listDataSource                                  
>>>                                                                        
>>>                            
>>> [javax.sql.DataSource]
>>> ----------------------
>>>  dataSourceName = jdbc/xyz
>>>  felix.fileinstall.filename =
>>> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>>>  osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>>>  osgi.jndi.service.name = jdbc/xyz
>>>  password = password
>>>  pax.jdbc.managed = true
>>>  pool.maxIdle = 25
>>>  pool.maxTotal = 8
>>>  service.bundleid = 16
>>>  service.factoryPid = org.ops4j.datasource
>>>  service.id <http://service.id> <http://service.id/> = 274
>>>  service.pid = org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>>>  service.scope = singleton
>>>  url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>  user = user
>>> Provided by : 
>>>  OPS4J Pax JDBC Config (16)
>>> Used by: 
>>>  Xyz :: Data Model (190)
>>>  Xyz :: Repository Services Impl. (200)
>>>
>>> *karaf*@root()> service:listPooledDataSourceFactory
>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>> --------------------------------------------------------
>>>  pool = dbcp2
>>>  service.bundleid = 86
>>>  service.id <http://service.id> <http://service.id/> = 113
>>>  service.scope = singleton
>>>  xa = false
>>> Provided by : 
>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>> Used by: 
>>>  OPS4J Pax JDBC Config (16)
>>>
>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>> --------------------------------------------------------
>>>  pool = dbcp2
>>>  service.bundleid = 86
>>>  service.id <http://service.id> <http://service.id/> = 116
>>>  service.scope = singleton
>>>  xa = true
>>> Provided by : 
>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>
>>> *karaf*@root()>                                                         
>>>                                                                        
>>>                                                
>>
>> --
>> Jean-Baptiste Onofré
>> [hidden email] <mailto:[hidden email]>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

Erwin Hogeweg


On Sep 10, 2018, at 09:33, Jean-Baptiste Onofré <[hidden email]> wrote:

What's the output of bundle:services -p 86 ?

karaf@root()> bundle:services -p 86                                                                                                                                                           

OPS4J Pax JDBC Pooling DBCP2 (86) provides:
-------------------------------------------
objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
pool = dbcp2
service.bundleid = 86
service.scope = singleton
xa = false
----
objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
pool = dbcp2
service.bundleid = 86
service.scope = singleton
xa = true
karaf@root()>                                                                                                                                                                                 


All pool properties are not as service properties, they are only config
properties.

Regards
JB

On 10/09/2018 15:23, Erwin Hogeweg wrote:
Thanks JB,

The pool uses "pool." prefix in the config.

So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
another one.
That is what I thought, but those properties don’t show up in the
PooledDataSourceFactory (see below). Is that expected?

Thanks,

Erwin


[javax.sql.DataSource]
———————————


*pool.maxIdle = 25
 pool.maxTotal = 8
*


[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id> <http://service.id/> = 113
 service.scope = singleton
 xa = false
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)
Used by: 
 OPS4J Pax JDBC Config (16)

[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id> <http://service.id/> = 116
 service.scope = singleton
 xa = true
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)




You can use any DBCP configuration as soon as you prefix with "pool.":

maxIdle
maxTotal
maxWaitMillis
testOnBorrow
validationQuery
validationQueryTimeout

Regards
JB

On 10/09/2018 14:10, Erwin Hogeweg wrote:
All -

Is anyone aware of changes in the DB pool configuration parameters in
4.2.1? I can’t find any documentation re. that.

The error I received in 4.2.0 is gone, but I can’t figure out how to
configure the pool. I tried all possible combination of pool. factory.
and property but none seem to work.

Any pointer to an example or a document would be very much appreciated.

FWIW, This is my datasource .cfg

osgi.jdbc.driver.class=com.mysql.jdbc.Driver
url=jdbc:<a href="mysql://my_db_server:3306/xyz?useSSL=false" class="">mysql://my_db_server:3306/xyz?useSSL=false
dataSourceName=jdbc/_xyz_
user=_user_
password=_password_
pool=dbcp2
xa=false

pool.maxTotal=8
pool.maxIdle=25

And these are the generated services:

*karaf*@root()> service:listDataSource                                  
                                                                       
                           
[javax.sql.DataSource]
----------------------
 dataSourceName = jdbc/xyz
 felix.fileinstall.filename =
file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
 osgi.jdbc.driver.class = com.mysql.jdbc.Driver
 osgi.jndi.service.name = jdbc/xyz
 password = password
 pax.jdbc.managed = true
 pool.maxIdle = 25
 pool.maxTotal = 8
 service.bundleid = 16
 service.factoryPid = org.ops4j.datasource
 service.id <http://service.id> <http://service.id/> = 274
 service.pid = org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
 service.scope = singleton
 url = jdbc:<a href="mysql://my_db_server:3306/xyz?useSSL=false" class="">mysql://my_db_server:3306/xyz?useSSL=false
 user = user
Provided by : 
 OPS4J Pax JDBC Config (16)
Used by: 
 Xyz :: Data Model (190)
 Xyz :: Repository Services Impl. (200)

*karaf*@root()> service:listPooledDataSourceFactory
[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id> <http://service.id/> = 113
 service.scope = singleton
 xa = false
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)
Used by: 
 OPS4J Pax JDBC Config (16)

[org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
--------------------------------------------------------
 pool = dbcp2
 service.bundleid = 86
 service.id <http://service.id> <http://service.id/> = 116
 service.scope = singleton
 xa = true
Provided by : 
 OPS4J Pax JDBC Pooling DBCP2 (86)

*karaf*@root()>                                                         
                                                                       
                                               

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


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

Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

jbonofre
It looks good to me as you should have a configuration with the pool
configuration right (ManagedServiceFactory) ?

Regards
JB

On 10/09/2018 15:37, Erwin Hogeweg wrote:

>
>
>> On Sep 10, 2018, at 09:33, Jean-Baptiste Onofré <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>> What's the output of bundle:services -p 86 ?
>
> *karaf*@root()> bundle:services-p 86                                   
>                                                                        
>                                                
>
> OPS4J Pax JDBC Pooling DBCP2 (86) provides:
> -------------------------------------------
> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
> pool = dbcp2
> service.bundleid = 86
> service.id <http://service.id> = 267
> service.scope = singleton
> xa = false
> ----
> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
> pool = dbcp2
> service.bundleid = 86
> service.id <http://service.id> = 310
> service.scope = singleton
> xa = true
> *karaf*@root()>                                                         
>                                                                        
>                                                
>
>>
>> All pool properties are not as service properties, they are only config
>> properties.
>>
>> Regards
>> JB
>>
>> On 10/09/2018 15:23, Erwin Hogeweg wrote:
>>> Thanks JB,
>>>
>>>> The pool uses "pool." prefix in the config.
>>>>
>>>> So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
>>>> another one.
>>> That is what I thought, but those properties don’t show up in the
>>> PooledDataSourceFactory (see below). Is that expected?
>>>
>>> Thanks,
>>>
>>> Erwin
>>>
>>>
>>>>> [javax.sql.DataSource]
>>>>> ———————————
>>>>> …
>>>
>>>>> *pool.maxIdle = 25
>>>>>  pool.maxTotal = 8
>>>>> *
>>>
>>>
>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>> --------------------------------------------------------
>>>>>  pool = dbcp2
>>>>>  service.bundleid = 86
>>>>>  service.id <http://service.id/> <http://service.id
>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>  service.scope = singleton
>>>>>  xa = false
>>>>> Provided by : 
>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>> Used by: 
>>>>>  OPS4J Pax JDBC Config (16)
>>>>>
>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>> --------------------------------------------------------
>>>>>  pool = dbcp2
>>>>>  service.bundleid = 86
>>>>>  service.id <http://service.id/> <http://service.id
>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>  service.scope = singleton
>>>>>  xa = true
>>>>> Provided by : 
>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>
>>>
>>>
>>>>
>>>> You can use any DBCP configuration as soon as you prefix with "pool.":
>>>>
>>>> maxIdle
>>>> maxTotal
>>>> maxWaitMillis
>>>> testOnBorrow
>>>> validationQuery
>>>> validationQueryTimeout
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 10/09/2018 14:10, Erwin Hogeweg wrote:
>>>>> All -
>>>>>
>>>>> Is anyone aware of changes in the DB pool configuration parameters in
>>>>> 4.2.1? I can’t find any documentation re. that.
>>>>>
>>>>> The error I received in 4.2.0 is gone, but I can’t figure out how to
>>>>> configure the pool. I tried all possible combination of pool. factory.
>>>>> and property but none seem to work.
>>>>>
>>>>> Any pointer to an example or a document would be very much appreciated.
>>>>>
>>>>> FWIW, This is my datasource .cfg
>>>>>
>>>>> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
>>>>> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>> dataSourceName=jdbc/_xyz_
>>>>> user=_user_
>>>>> password=_password_
>>>>> pool=dbcp2
>>>>> xa=false
>>>>>
>>>>> pool.maxTotal=8
>>>>> pool.maxIdle=25
>>>>>
>>>>> And these are the generated services:
>>>>>
>>>>> *karaf*@root()> service:listDataSource                            
>>>>>      
>>>>>                                                                        
>>>>>                            
>>>>> [javax.sql.DataSource]
>>>>> ----------------------
>>>>>  dataSourceName = jdbc/xyz
>>>>>  felix.fileinstall.filename =
>>>>> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>>>>>  osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>>>>>  osgi.jndi.service.name = jdbc/xyz
>>>>>  password = password
>>>>>  pax.jdbc.managed = true
>>>>>  pool.maxIdle = 25
>>>>>  pool.maxTotal = 8
>>>>>  service.bundleid = 16
>>>>>  service.factoryPid = org.ops4j.datasource
>>>>>  service.id <http://service.id/> <http://service.id
>>>>> <http://service.id/>> <http://service.id/> = 274
>>>>>  service.pid =
>>>>> org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>>>>>  service.scope = singleton
>>>>>  url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>  user = user
>>>>> Provided by : 
>>>>>  OPS4J Pax JDBC Config (16)
>>>>> Used by: 
>>>>>  Xyz :: Data Model (190)
>>>>>  Xyz :: Repository Services Impl. (200)
>>>>>
>>>>> *karaf*@root()> service:listPooledDataSourceFactory
>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>> --------------------------------------------------------
>>>>>  pool = dbcp2
>>>>>  service.bundleid = 86
>>>>>  service.id <http://service.id/> <http://service.id
>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>  service.scope = singleton
>>>>>  xa = false
>>>>> Provided by : 
>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>> Used by: 
>>>>>  OPS4J Pax JDBC Config (16)
>>>>>
>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>> --------------------------------------------------------
>>>>>  pool = dbcp2
>>>>>  service.bundleid = 86
>>>>>  service.id <http://service.id/> <http://service.id
>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>  service.scope = singleton
>>>>>  xa = true
>>>>> Provided by : 
>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>
>>>>> *karaf*@root()>                                                   
>>>>>      
>>>>>                                                                        
>>>>>                                                
>>>>
>>>> -- 
>>>> Jean-Baptiste Onofré
>>>> [hidden email]
>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>
>>
>> -- 
>> Jean-Baptiste Onofré
>> [hidden email] <mailto:[hidden email]>
>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>> Talend - http://www.talend.com <http://www.talend.com/>
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

fpapon
Hi,

There is some examples on the PaxJDBC wiki where they mentioned a
"jdbc.pool" prefix :

https://ops4j1.jira.com/wiki/spaces/PAXJDBC/pages/119078914/Pooling+and+XA+support+in+1.0.0

regards,

François Papon
[hidden email]

Le 10/09/2018 à 17:46, Jean-Baptiste Onofré a écrit :

> It looks good to me as you should have a configuration with the pool
> configuration right (ManagedServiceFactory) ?
>
> Regards
> JB
>
> On 10/09/2018 15:37, Erwin Hogeweg wrote:
>>
>>> On Sep 10, 2018, at 09:33, Jean-Baptiste Onofré <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>> What's the output of bundle:services -p 86 ?
>> *karaf*@root()> bundle:services-p 86                                   
>>                                                                        
>>                                                
>>
>> OPS4J Pax JDBC Pooling DBCP2 (86) provides:
>> -------------------------------------------
>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>> pool = dbcp2
>> service.bundleid = 86
>> service.id <http://service.id> = 267
>> service.scope = singleton
>> xa = false
>> ----
>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>> pool = dbcp2
>> service.bundleid = 86
>> service.id <http://service.id> = 310
>> service.scope = singleton
>> xa = true
>> *karaf*@root()>                                                         
>>                                                                        
>>                                                
>>
>>> All pool properties are not as service properties, they are only config
>>> properties.
>>>
>>> Regards
>>> JB
>>>
>>> On 10/09/2018 15:23, Erwin Hogeweg wrote:
>>>> Thanks JB,
>>>>
>>>>> The pool uses "pool." prefix in the config.
>>>>>
>>>>> So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
>>>>> another one.
>>>> That is what I thought, but those properties don’t show up in the
>>>> PooledDataSourceFactory (see below). Is that expected?
>>>>
>>>> Thanks,
>>>>
>>>> Erwin
>>>>
>>>>
>>>>>> [javax.sql.DataSource]
>>>>>> ———————————
>>>>>> …
>>>>>> *pool.maxIdle = 25
>>>>>>  pool.maxTotal = 8
>>>>>> *
>>>>
>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>> --------------------------------------------------------
>>>>>>  pool = dbcp2
>>>>>>  service.bundleid = 86
>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>  service.scope = singleton
>>>>>>  xa = false
>>>>>> Provided by : 
>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>> Used by: 
>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>
>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>> --------------------------------------------------------
>>>>>>  pool = dbcp2
>>>>>>  service.bundleid = 86
>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>  service.scope = singleton
>>>>>>  xa = true
>>>>>> Provided by : 
>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>
>>>>
>>>>> You can use any DBCP configuration as soon as you prefix with "pool.":
>>>>>
>>>>> maxIdle
>>>>> maxTotal
>>>>> maxWaitMillis
>>>>> testOnBorrow
>>>>> validationQuery
>>>>> validationQueryTimeout
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 10/09/2018 14:10, Erwin Hogeweg wrote:
>>>>>> All -
>>>>>>
>>>>>> Is anyone aware of changes in the DB pool configuration parameters in
>>>>>> 4.2.1? I can’t find any documentation re. that.
>>>>>>
>>>>>> The error I received in 4.2.0 is gone, but I can’t figure out how to
>>>>>> configure the pool. I tried all possible combination of pool. factory.
>>>>>> and property but none seem to work.
>>>>>>
>>>>>> Any pointer to an example or a document would be very much appreciated.
>>>>>>
>>>>>> FWIW, This is my datasource .cfg
>>>>>>
>>>>>> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
>>>>>> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>> dataSourceName=jdbc/_xyz_
>>>>>> user=_user_
>>>>>> password=_password_
>>>>>> pool=dbcp2
>>>>>> xa=false
>>>>>>
>>>>>> pool.maxTotal=8
>>>>>> pool.maxIdle=25
>>>>>>
>>>>>> And these are the generated services:
>>>>>>
>>>>>> *karaf*@root()> service:listDataSource                            
>>>>>>      
>>>>>>                                                                        
>>>>>>                            
>>>>>> [javax.sql.DataSource]
>>>>>> ----------------------
>>>>>>  dataSourceName = jdbc/xyz
>>>>>>  felix.fileinstall.filename =
>>>>>> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>>>>>>  osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>>>>>>  osgi.jndi.service.name = jdbc/xyz
>>>>>>  password = password
>>>>>>  pax.jdbc.managed = true
>>>>>>  pool.maxIdle = 25
>>>>>>  pool.maxTotal = 8
>>>>>>  service.bundleid = 16
>>>>>>  service.factoryPid = org.ops4j.datasource
>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>> <http://service.id/>> <http://service.id/> = 274
>>>>>>  service.pid =
>>>>>> org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>>>>>>  service.scope = singleton
>>>>>>  url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>  user = user
>>>>>> Provided by : 
>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>> Used by: 
>>>>>>  Xyz :: Data Model (190)
>>>>>>  Xyz :: Repository Services Impl. (200)
>>>>>>
>>>>>> *karaf*@root()> service:listPooledDataSourceFactory
>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>> --------------------------------------------------------
>>>>>>  pool = dbcp2
>>>>>>  service.bundleid = 86
>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>  service.scope = singleton
>>>>>>  xa = false
>>>>>> Provided by : 
>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>> Used by: 
>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>
>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>> --------------------------------------------------------
>>>>>>  pool = dbcp2
>>>>>>  service.bundleid = 86
>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>  service.scope = singleton
>>>>>>  xa = true
>>>>>> Provided by : 
>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>
>>>>>> *karaf*@root()>                                                   
>>>>>>      
>>>>>>                                                                        
>>>>>>                                                
>>>>> -- 
>>>>> Jean-Baptiste Onofré
>>>>> [hidden email]
>>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>> -- 
>>> Jean-Baptiste Onofré
>>> [hidden email] <mailto:[hidden email]>
>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>> Talend - http://www.talend.com <http://www.talend.com/>

François Papon
fpapon@apache.org
Yupiik - https://www.yupiik.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

Erwin Hogeweg
JB and François,

Thanks, I am familiar with the PaxJDBC wiki. I guess I expected to see those pool properties in the PooledDataSourceFactory.

I DO see multiple DB connections, so I assume everything is working as expected.

Thanks for the clarification.

Erwin

> On Sep 10, 2018, at 10:02, Francois Papon <[hidden email]> wrote:
>
> Hi,
>
> There is some examples on the PaxJDBC wiki where they mentioned a
> "jdbc.pool" prefix :
>
> https://ops4j1.jira.com/wiki/spaces/PAXJDBC/pages/119078914/Pooling+and+XA+support+in+1.0.0
>
> regards,
>
> François Papon
> [hidden email]
>
> Le 10/09/2018 à 17:46, Jean-Baptiste Onofré a écrit :
>> It looks good to me as you should have a configuration with the pool
>> configuration right (ManagedServiceFactory) ?
>>
>> Regards
>> JB
>>
>> On 10/09/2018 15:37, Erwin Hogeweg wrote:
>>>
>>>> On Sep 10, 2018, at 09:33, Jean-Baptiste Onofré <[hidden email]
>>>> <mailto:[hidden email]>> wrote:
>>>>
>>>> What's the output of bundle:services -p 86 ?
>>> *karaf*@root()> bundle:services-p 86                                  
>>>                                                                        
>>>                                                
>>>
>>> OPS4J Pax JDBC Pooling DBCP2 (86) provides:
>>> -------------------------------------------
>>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>> pool = dbcp2
>>> service.bundleid = 86
>>> service.id <http://service.id> = 267
>>> service.scope = singleton
>>> xa = false
>>> ----
>>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>> pool = dbcp2
>>> service.bundleid = 86
>>> service.id <http://service.id> = 310
>>> service.scope = singleton
>>> xa = true
>>> *karaf*@root()>                                                        
>>>                                                                        
>>>                                                
>>>
>>>> All pool properties are not as service properties, they are only config
>>>> properties.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 10/09/2018 15:23, Erwin Hogeweg wrote:
>>>>> Thanks JB,
>>>>>
>>>>>> The pool uses "pool." prefix in the config.
>>>>>>
>>>>>> So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
>>>>>> another one.
>>>>> That is what I thought, but those properties don’t show up in the
>>>>> PooledDataSourceFactory (see below). Is that expected?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Erwin
>>>>>
>>>>>
>>>>>>> [javax.sql.DataSource]
>>>>>>> ———————————
>>>>>>> …
>>>>>>> *pool.maxIdle = 25
>>>>>>>  pool.maxTotal = 8
>>>>>>> *
>>>>>
>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>> --------------------------------------------------------
>>>>>>>  pool = dbcp2
>>>>>>>  service.bundleid = 86
>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>>  service.scope = singleton
>>>>>>>  xa = false
>>>>>>> Provided by :
>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>> Used by:
>>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>>
>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>> --------------------------------------------------------
>>>>>>>  pool = dbcp2
>>>>>>>  service.bundleid = 86
>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>>  service.scope = singleton
>>>>>>>  xa = true
>>>>>>> Provided by :
>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>
>>>>>
>>>>>> You can use any DBCP configuration as soon as you prefix with "pool.":
>>>>>>
>>>>>> maxIdle
>>>>>> maxTotal
>>>>>> maxWaitMillis
>>>>>> testOnBorrow
>>>>>> validationQuery
>>>>>> validationQueryTimeout
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> On 10/09/2018 14:10, Erwin Hogeweg wrote:
>>>>>>> All -
>>>>>>>
>>>>>>> Is anyone aware of changes in the DB pool configuration parameters in
>>>>>>> 4.2.1? I can’t find any documentation re. that.
>>>>>>>
>>>>>>> The error I received in 4.2.0 is gone, but I can’t figure out how to
>>>>>>> configure the pool. I tried all possible combination of pool. factory.
>>>>>>> and property but none seem to work.
>>>>>>>
>>>>>>> Any pointer to an example or a document would be very much appreciated.
>>>>>>>
>>>>>>> FWIW, This is my datasource .cfg
>>>>>>>
>>>>>>> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
>>>>>>> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>> dataSourceName=jdbc/_xyz_
>>>>>>> user=_user_
>>>>>>> password=_password_
>>>>>>> pool=dbcp2
>>>>>>> xa=false
>>>>>>>
>>>>>>> pool.maxTotal=8
>>>>>>> pool.maxIdle=25
>>>>>>>
>>>>>>> And these are the generated services:
>>>>>>>
>>>>>>> *karaf*@root()> service:listDataSource                            
>>>>>>>      
>>>>>>>                                                                        
>>>>>>>                            
>>>>>>> [javax.sql.DataSource]
>>>>>>> ----------------------
>>>>>>>  dataSourceName = jdbc/xyz
>>>>>>>  felix.fileinstall.filename =
>>>>>>> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>>>>>>>  osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>>>>>>>  osgi.jndi.service.name = jdbc/xyz
>>>>>>>  password = password
>>>>>>>  pax.jdbc.managed = true
>>>>>>>  pool.maxIdle = 25
>>>>>>>  pool.maxTotal = 8
>>>>>>>  service.bundleid = 16
>>>>>>>  service.factoryPid = org.ops4j.datasource
>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>> <http://service.id/>> <http://service.id/> = 274
>>>>>>>  service.pid =
>>>>>>> org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>>>>>>>  service.scope = singleton
>>>>>>>  url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>>  user = user
>>>>>>> Provided by :
>>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>> Used by:
>>>>>>>  Xyz :: Data Model (190)
>>>>>>>  Xyz :: Repository Services Impl. (200)
>>>>>>>
>>>>>>> *karaf*@root()> service:listPooledDataSourceFactory
>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>> --------------------------------------------------------
>>>>>>>  pool = dbcp2
>>>>>>>  service.bundleid = 86
>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>>  service.scope = singleton
>>>>>>>  xa = false
>>>>>>> Provided by :
>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>> Used by:
>>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>>
>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>> --------------------------------------------------------
>>>>>>>  pool = dbcp2
>>>>>>>  service.bundleid = 86
>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>>  service.scope = singleton
>>>>>>>  xa = true
>>>>>>> Provided by :
>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>
>>>>>>> *karaf*@root()>                                                  
>>>>>>>      
>>>>>>>                                                                        
>>>>>>>                                                
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> [hidden email]
>>>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> [hidden email] <mailto:[hidden email]>
>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>> Talend - http://www.talend.com <http://www.talend.com/>
>

Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

jbonofre
Hi Erwin,

there a "config" properties of the PooledDataSourceFactory (acting as a
ManagedService), not "service" properties. I think that where you
confusion comes from.

Regards
JB

On 10/09/2018 16:12, Erwin Hogeweg wrote:

> JB and François,
>
> Thanks, I am familiar with the PaxJDBC wiki. I guess I expected to see those pool properties in the PooledDataSourceFactory.
>
> I DO see multiple DB connections, so I assume everything is working as expected.
>
> Thanks for the clarification.
>
> Erwin
>
>> On Sep 10, 2018, at 10:02, Francois Papon <[hidden email]> wrote:
>>
>> Hi,
>>
>> There is some examples on the PaxJDBC wiki where they mentioned a
>> "jdbc.pool" prefix :
>>
>> https://ops4j1.jira.com/wiki/spaces/PAXJDBC/pages/119078914/Pooling+and+XA+support+in+1.0.0
>>
>> regards,
>>
>> François Papon
>> [hidden email]
>>
>> Le 10/09/2018 à 17:46, Jean-Baptiste Onofré a écrit :
>>> It looks good to me as you should have a configuration with the pool
>>> configuration right (ManagedServiceFactory) ?
>>>
>>> Regards
>>> JB
>>>
>>> On 10/09/2018 15:37, Erwin Hogeweg wrote:
>>>>
>>>>> On Sep 10, 2018, at 09:33, Jean-Baptiste Onofré <[hidden email]
>>>>> <mailto:[hidden email]>> wrote:
>>>>>
>>>>> What's the output of bundle:services -p 86 ?
>>>> *karaf*@root()> bundle:services-p 86                                  
>>>>                                                                        
>>>>                                                
>>>>
>>>> OPS4J Pax JDBC Pooling DBCP2 (86) provides:
>>>> -------------------------------------------
>>>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>> pool = dbcp2
>>>> service.bundleid = 86
>>>> service.id <http://service.id> = 267
>>>> service.scope = singleton
>>>> xa = false
>>>> ----
>>>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>> pool = dbcp2
>>>> service.bundleid = 86
>>>> service.id <http://service.id> = 310
>>>> service.scope = singleton
>>>> xa = true
>>>> *karaf*@root()>                                                        
>>>>                                                                        
>>>>                                                
>>>>
>>>>> All pool properties are not as service properties, they are only config
>>>>> properties.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 10/09/2018 15:23, Erwin Hogeweg wrote:
>>>>>> Thanks JB,
>>>>>>
>>>>>>> The pool uses "pool." prefix in the config.
>>>>>>>
>>>>>>> So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
>>>>>>> another one.
>>>>>> That is what I thought, but those properties don’t show up in the
>>>>>> PooledDataSourceFactory (see below). Is that expected?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Erwin
>>>>>>
>>>>>>
>>>>>>>> [javax.sql.DataSource]
>>>>>>>> ———————————
>>>>>>>> …
>>>>>>>> *pool.maxIdle = 25
>>>>>>>>  pool.maxTotal = 8
>>>>>>>> *
>>>>>>
>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>> --------------------------------------------------------
>>>>>>>>  pool = dbcp2
>>>>>>>>  service.bundleid = 86
>>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>>>  service.scope = singleton
>>>>>>>>  xa = false
>>>>>>>> Provided by :
>>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>> Used by:
>>>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>>>
>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>> --------------------------------------------------------
>>>>>>>>  pool = dbcp2
>>>>>>>>  service.bundleid = 86
>>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>>>  service.scope = singleton
>>>>>>>>  xa = true
>>>>>>>> Provided by :
>>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>
>>>>>>
>>>>>>> You can use any DBCP configuration as soon as you prefix with "pool.":
>>>>>>>
>>>>>>> maxIdle
>>>>>>> maxTotal
>>>>>>> maxWaitMillis
>>>>>>> testOnBorrow
>>>>>>> validationQuery
>>>>>>> validationQueryTimeout
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> On 10/09/2018 14:10, Erwin Hogeweg wrote:
>>>>>>>> All -
>>>>>>>>
>>>>>>>> Is anyone aware of changes in the DB pool configuration parameters in
>>>>>>>> 4.2.1? I can’t find any documentation re. that.
>>>>>>>>
>>>>>>>> The error I received in 4.2.0 is gone, but I can’t figure out how to
>>>>>>>> configure the pool. I tried all possible combination of pool. factory.
>>>>>>>> and property but none seem to work.
>>>>>>>>
>>>>>>>> Any pointer to an example or a document would be very much appreciated.
>>>>>>>>
>>>>>>>> FWIW, This is my datasource .cfg
>>>>>>>>
>>>>>>>> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
>>>>>>>> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>>> dataSourceName=jdbc/_xyz_
>>>>>>>> user=_user_
>>>>>>>> password=_password_
>>>>>>>> pool=dbcp2
>>>>>>>> xa=false
>>>>>>>>
>>>>>>>> pool.maxTotal=8
>>>>>>>> pool.maxIdle=25
>>>>>>>>
>>>>>>>> And these are the generated services:
>>>>>>>>
>>>>>>>> *karaf*@root()> service:listDataSource                            
>>>>>>>>      
>>>>>>>>                                                                        
>>>>>>>>                            
>>>>>>>> [javax.sql.DataSource]
>>>>>>>> ----------------------
>>>>>>>>  dataSourceName = jdbc/xyz
>>>>>>>>  felix.fileinstall.filename =
>>>>>>>> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>>>>>>>>  osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>>>>>>>>  osgi.jndi.service.name = jdbc/xyz
>>>>>>>>  password = password
>>>>>>>>  pax.jdbc.managed = true
>>>>>>>>  pool.maxIdle = 25
>>>>>>>>  pool.maxTotal = 8
>>>>>>>>  service.bundleid = 16
>>>>>>>>  service.factoryPid = org.ops4j.datasource
>>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>>> <http://service.id/>> <http://service.id/> = 274
>>>>>>>>  service.pid =
>>>>>>>> org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>>>>>>>>  service.scope = singleton
>>>>>>>>  url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>>>  user = user
>>>>>>>> Provided by :
>>>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>>> Used by:
>>>>>>>>  Xyz :: Data Model (190)
>>>>>>>>  Xyz :: Repository Services Impl. (200)
>>>>>>>>
>>>>>>>> *karaf*@root()> service:listPooledDataSourceFactory
>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>> --------------------------------------------------------
>>>>>>>>  pool = dbcp2
>>>>>>>>  service.bundleid = 86
>>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>>>  service.scope = singleton
>>>>>>>>  xa = false
>>>>>>>> Provided by :
>>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>> Used by:
>>>>>>>>  OPS4J Pax JDBC Config (16)
>>>>>>>>
>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>> --------------------------------------------------------
>>>>>>>>  pool = dbcp2
>>>>>>>>  service.bundleid = 86
>>>>>>>>  service.id <http://service.id/> <http://service.id
>>>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>>>  service.scope = singleton
>>>>>>>>  xa = true
>>>>>>>> Provided by :
>>>>>>>>  OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>>
>>>>>>>> *karaf*@root()>                                                  
>>>>>>>>      
>>>>>>>>                                                                        
>>>>>>>>                                                
>>>>>>> --
>>>>>>> Jean-Baptiste Onofré
>>>>>>> [hidden email]
>>>>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> [hidden email] <mailto:[hidden email]>
>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4.2.1 - Has DB connection pool configuration for pax-jdbc-config changed?

Erwin Hogeweg
Yup, I think you are right.

Thanks,

Eewin

> On Sep 10, 2018, at 10:54, Jean-Baptiste Onofré <[hidden email]> wrote:
>
> Hi Erwin,
>
> there a "config" properties of the PooledDataSourceFactory (acting as a
> ManagedService), not "service" properties. I think that where you
> confusion comes from.
>
> Regards
> JB
>
> On 10/09/2018 16:12, Erwin Hogeweg wrote:
>> JB and François,
>>
>> Thanks, I am familiar with the PaxJDBC wiki. I guess I expected to see those pool properties in the PooledDataSourceFactory.
>>
>> I DO see multiple DB connections, so I assume everything is working as expected.
>>
>> Thanks for the clarification.
>>
>> Erwin
>>
>>> On Sep 10, 2018, at 10:02, Francois Papon <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> There is some examples on the PaxJDBC wiki where they mentioned a
>>> "jdbc.pool" prefix :
>>>
>>> https://ops4j1.jira.com/wiki/spaces/PAXJDBC/pages/119078914/Pooling+and+XA+support+in+1.0.0
>>>
>>> regards,
>>>
>>> François Papon
>>> [hidden email]
>>>
>>> Le 10/09/2018 à 17:46, Jean-Baptiste Onofré a écrit :
>>>> It looks good to me as you should have a configuration with the pool
>>>> configuration right (ManagedServiceFactory) ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 10/09/2018 15:37, Erwin Hogeweg wrote:
>>>>>
>>>>>> On Sep 10, 2018, at 09:33, Jean-Baptiste Onofré <[hidden email]
>>>>>> <mailto:[hidden email]>> wrote:
>>>>>>
>>>>>> What's the output of bundle:services -p 86 ?
>>>>> *karaf*@root()> bundle:services-p 86                                  
>>>>>
>>>>>
>>>>>
>>>>> OPS4J Pax JDBC Pooling DBCP2 (86) provides:
>>>>> -------------------------------------------
>>>>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>> pool = dbcp2
>>>>> service.bundleid = 86
>>>>> service.id <http://service.id> = 267
>>>>> service.scope = singleton
>>>>> xa = false
>>>>> ----
>>>>> objectClass = [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>> pool = dbcp2
>>>>> service.bundleid = 86
>>>>> service.id <http://service.id> = 310
>>>>> service.scope = singleton
>>>>> xa = true
>>>>> *karaf*@root()>                                                        
>>>>>
>>>>>
>>>>>
>>>>>> All pool properties are not as service properties, they are only config
>>>>>> properties.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> On 10/09/2018 15:23, Erwin Hogeweg wrote:
>>>>>>> Thanks JB,
>>>>>>>
>>>>>>>> The pool uses "pool." prefix in the config.
>>>>>>>>
>>>>>>>> So pool.maxTotal is a valid configuration in DBCP, pool.dummy is
>>>>>>>> another one.
>>>>>>> That is what I thought, but those properties don’t show up in the
>>>>>>> PooledDataSourceFactory (see below). Is that expected?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Erwin
>>>>>>>
>>>>>>>
>>>>>>>>> [javax.sql.DataSource]
>>>>>>>>> ———————————
>>>>>>>>> …
>>>>>>>>> *pool.maxIdle = 25
>>>>>>>>> pool.maxTotal = 8
>>>>>>>>> *
>>>>>>>
>>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>>> --------------------------------------------------------
>>>>>>>>> pool = dbcp2
>>>>>>>>> service.bundleid = 86
>>>>>>>>> service.id <http://service.id/> <http://service.id
>>>>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>>>> service.scope = singleton
>>>>>>>>> xa = false
>>>>>>>>> Provided by :
>>>>>>>>> OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>>> Used by:
>>>>>>>>> OPS4J Pax JDBC Config (16)
>>>>>>>>>
>>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>>> --------------------------------------------------------
>>>>>>>>> pool = dbcp2
>>>>>>>>> service.bundleid = 86
>>>>>>>>> service.id <http://service.id/> <http://service.id
>>>>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>>>> service.scope = singleton
>>>>>>>>> xa = true
>>>>>>>>> Provided by :
>>>>>>>>> OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>
>>>>>>>
>>>>>>>> You can use any DBCP configuration as soon as you prefix with "pool.":
>>>>>>>>
>>>>>>>> maxIdle
>>>>>>>> maxTotal
>>>>>>>> maxWaitMillis
>>>>>>>> testOnBorrow
>>>>>>>> validationQuery
>>>>>>>> validationQueryTimeout
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>>>>>>
>>>>>>>> On 10/09/2018 14:10, Erwin Hogeweg wrote:
>>>>>>>>> All -
>>>>>>>>>
>>>>>>>>> Is anyone aware of changes in the DB pool configuration parameters in
>>>>>>>>> 4.2.1? I can’t find any documentation re. that.
>>>>>>>>>
>>>>>>>>> The error I received in 4.2.0 is gone, but I can’t figure out how to
>>>>>>>>> configure the pool. I tried all possible combination of pool. factory.
>>>>>>>>> and property but none seem to work.
>>>>>>>>>
>>>>>>>>> Any pointer to an example or a document would be very much appreciated.
>>>>>>>>>
>>>>>>>>> FWIW, This is my datasource .cfg
>>>>>>>>>
>>>>>>>>> osgi.jdbc.driver.class=com.mysql.jdbc.Driver
>>>>>>>>> url=jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>>>> dataSourceName=jdbc/_xyz_
>>>>>>>>> user=_user_
>>>>>>>>> password=_password_
>>>>>>>>> pool=dbcp2
>>>>>>>>> xa=false
>>>>>>>>>
>>>>>>>>> pool.maxTotal=8
>>>>>>>>> pool.maxIdle=25
>>>>>>>>>
>>>>>>>>> And these are the generated services:
>>>>>>>>>
>>>>>>>>> *karaf*@root()> service:listDataSource                            
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> [javax.sql.DataSource]
>>>>>>>>> ----------------------
>>>>>>>>> dataSourceName = jdbc/xyz
>>>>>>>>> felix.fileinstall.filename =
>>>>>>>>> file:/Users/erwin/work/Xyz/trunk/src/server/karaf.distro/target/assembly/etc/org.ops4j.datasource-xyz.cfg
>>>>>>>>> osgi.jdbc.driver.class = com.mysql.jdbc.Driver
>>>>>>>>> osgi.jndi.service.name = jdbc/xyz
>>>>>>>>> password = password
>>>>>>>>> pax.jdbc.managed = true
>>>>>>>>> pool.maxIdle = 25
>>>>>>>>> pool.maxTotal = 8
>>>>>>>>> service.bundleid = 16
>>>>>>>>> service.factoryPid = org.ops4j.datasource
>>>>>>>>> service.id <http://service.id/> <http://service.id
>>>>>>>>> <http://service.id/>> <http://service.id/> = 274
>>>>>>>>> service.pid =
>>>>>>>>> org.ops4j.datasource.7b57f2dc-2d66-40c1-8e0a-4e6b8e4f23da
>>>>>>>>> service.scope = singleton
>>>>>>>>> url = jdbc:mysql://my_db_server:3306/xyz?useSSL=false
>>>>>>>>> user = user
>>>>>>>>> Provided by :
>>>>>>>>> OPS4J Pax JDBC Config (16)
>>>>>>>>> Used by:
>>>>>>>>> Xyz :: Data Model (190)
>>>>>>>>> Xyz :: Repository Services Impl. (200)
>>>>>>>>>
>>>>>>>>> *karaf*@root()> service:listPooledDataSourceFactory
>>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>>> --------------------------------------------------------
>>>>>>>>> pool = dbcp2
>>>>>>>>> service.bundleid = 86
>>>>>>>>> service.id <http://service.id/> <http://service.id
>>>>>>>>> <http://service.id/>> <http://service.id/> = 113
>>>>>>>>> service.scope = singleton
>>>>>>>>> xa = false
>>>>>>>>> Provided by :
>>>>>>>>> OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>>> Used by:
>>>>>>>>> OPS4J Pax JDBC Config (16)
>>>>>>>>>
>>>>>>>>> [org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory]
>>>>>>>>> --------------------------------------------------------
>>>>>>>>> pool = dbcp2
>>>>>>>>> service.bundleid = 86
>>>>>>>>> service.id <http://service.id/> <http://service.id
>>>>>>>>> <http://service.id/>> <http://service.id/> = 116
>>>>>>>>> service.scope = singleton
>>>>>>>>> xa = true
>>>>>>>>> Provided by :
>>>>>>>>> OPS4J Pax JDBC Pooling DBCP2 (86)
>>>>>>>>>
>>>>>>>>> *karaf*@root()>                                                  
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean-Baptiste Onofré
>>>>>>>> [hidden email]
>>>>>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>
>>
>
> --
> Jean-Baptiste Onofré
> [hidden email]
> http://blog.nanthrax.net
> Talend - http://www.talend.com