karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Soto <alex.s...@envieta.com>
Subject Re: pax-jdbc-config connection pool configuration
Date Tue, 15 May 2018 13:19:21 GMT
Oh, I missed this :) great!

Still, it may be too early for me to jump, has it been fully adopted and tested by the latest
Karaf? 

(Trying to avoid more bruises)

Best regards,
Alex soto




> On May 15, 2018, at 9:12 AM, Tim Ward <tim.ward@paremus.com> wrote:
> 
> R7 is formally released. The Alliance press release is here: https://www.osgi.org/osgi-core-release-7-and-compendium-release-7-now-available/
<https://www.osgi.org/osgi-core-release-7-and-compendium-release-7-now-available/>
> 
> Tim
> 
> Sent from my iPhone
> 
> On 15 May 2018, at 14:58, Alex Soto <alex.soto@envieta.com <mailto:alex.soto@envieta.com>>
wrote:
> 
>> I will read this Tim, thanks for sharing, but I can’t start using OSGi R7 until
it is released.
>> 
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On May 15, 2018, at 3:00 AM, Tim Ward <tim.ward@paremus.com <mailto:tim.ward@paremus.com>>
wrote:
>>> 
>>> Another option for connection pooling would be to use the OSGi Transaction Control
service from the R7 release. The resource providers all give implicit support for pooling,
and the Aries implementation allows you to create them purely from configuration. 
>>> 
>>> The transaction control service also provides a more reliable mechanism for managing
the transaction lifecycle than proxying/annotations. 
>>> 
>>> There’s a post about Transaction Control on the OSGi blog at https://blog.osgi.org/2018/05/osgi-r7-highlights-transaction-control.html
<https://blog.osgi.org/2018/05/osgi-r7-highlights-transaction-control.html?m=1> and
documentation at Apache Aries. The 1.0.0 release happened about two weeks ago and has been
tested in Karaf.
>>> 
>>> Best Regards,
>>> 
>>> Tim
>>> 
>>> Sent from my iPhone
>>> 
>>> On 15 May 2018, at 08:37, Christian Schneider <chris@die-schneider.net <mailto:chris@die-schneider.net>>
wrote:
>>> 
>>>> The docs indeed show to use jdbc.pool.maxTotal but in the code I see that
the pool properties are filtered using "pool." 
>>>> 
>>>> See:
>>>> https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-pool-dbcp2/src/main/java/org/ops4j/pax/jdbc/pool/dbcp2/impl/DbcpPooledDataSourceFactory.java
<https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-pool-dbcp2/src/main/java/org/ops4j/pax/jdbc/pool/dbcp2/impl/DbcpPooledDataSourceFactory.java>
>>>> 
>>>> So can you try with pool.maxTotal? Still this is a bug - either the docs
or the code is wrong.
>>>> 
>>>> You can find the link to the issue tracker on the top level of the code base
in the README:
>>>> https://github.com/ops4j/org.ops4j.pax.jdbc <https://github.com/ops4j/org.ops4j.pax.jdbc>
>>>> 
>>>> Be aware though that you need to ask for a jira user on the ops4j list (ops4j@googlegroups.com
<http://googlegroups.com/>) first. 
>>>> The self registration is switched off as there was lots of spam.
>>>> 
>>>> Christian
>>>> 
>>>> 
>>>> 2018-05-14 21:47 GMT+02:00 Alex Soto <alex.soto@envieta.com <mailto:alex.soto@envieta.com>>:
>>>> Using Karaf  4.2.0, I am trying to configure connection pool using pax-jdbc-config
 approach.  I installed features:
>>>> 
>>>> pax-jdbc-mariadb
>>>> pax-jdbc-config
>>>> pax-jdbc-pool-dbcp2
>>>> 
>>>> 
>>>> 
>>>> I dropped a org.ops4j.datasource-responder.cfg file in the etc directory:
>>>> 
>>>> osgi.jdbc.driver.name <http://osgi.jdbc.driver.name/> = mariadb
>>>> dataSourceName=responder
>>>> url = jdbc:mariadb://localhost:3306/responder <>
>>>> user=XXXX
>>>> password=XXXX
>>>> pool=dbcp2
>>>> xa=true
>>>> databaseName=responder
>>>> jdbc.pool.maxTotal=8
>>>> 
>>>> 
>>>> The last line causes this error:
>>>> 
>>>> cannot set properties [pool.maxTotal]
>>>> java.sql.SQLException: cannot set properties [pool.maxTotal]
>>>> 	at org.ops4j.pax.jdbc.mariadb.impl.MariaDbDataSourceFactory.setProperties(MariaDbDataSourceFactory.java:70)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.mariadb.impl.MariaDbDataSourceFactory.createDataSource(MariaDbDataSourceFactory.java:36)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceRegistration.createDs(DataSourceRegistration.java:134)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceRegistration.<init>(DataSourceRegistration.java:80)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.lambda$null$0(DataSourceConfigManager.java:81)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper$1.addingService(ServiceTrackerHelper.java:131)
~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
~[?:?]
>>>> 	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
~[?:?]
>>>> 	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318) ~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261) ~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:140)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.lambda$null$1(DataSourceConfigManager.java:77)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:146)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:85)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.lambda$null$2(DataSourceConfigManager.java:76)
~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper$1.addingService(ServiceTrackerHelper.java:131)
~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
~[?:?]
>>>> 	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
~[?:?]
>>>> 	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318) ~[?:?]
>>>> 	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261) ~[?:?]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:140)
~[14:org.ops4j.pax.jdbc.config:1.2.0]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:85)
~[14:org.ops4j.pax.jdbc.config:1.2.0]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.lambda$updated$3(DataSourceConfigManager.java:75)
~[14:org.ops4j.pax.jdbc.config:1.2.0]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:146)
[14:org.ops4j.pax.jdbc.config:1.2.0]
>>>> 	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper.track(ServiceTrackerHelper.java:85)
[14:org.ops4j.pax.jdbc.config:1.2.0]
>>>> 	at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.updated(DataSourceConfigManager.java:74)
[14:org.ops4j.pax.jdbc.config:1.2.0]
>>>> 	at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159)
[8:org.apache.felix.configadmin:1.8.16]
>>>> 	at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93)
[8:org.apache.felix.configadmin:1.8.16]
>>>> 	at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1792)
[8:org.apache.felix.configadmin:1.8.16]
>>>> 	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [8:org.apache.felix.configadmin:1.8.16]
>>>> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [8:org.apache.felix.configadmin:1.8.16]
>>>> 	at java.lang.Thread.run(Thread.java:748) [?:?]
>>>> 
>>>> 
>>>> How do I configure the various parameters of the connection pool?
>>>> 
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> -- 
>>>> Christian Schneider
>>>> http://www.liquid-reality.de <http://www.liquid-reality.de/>
>>>> 
>>>> Computer Scientist
>>>> http://www.adobe.com <http://www.adobe.com/>
>>>> 
>> 


Mime
View raw message