You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Erwin Hogeweg <er...@me.com> on 2016/12/22 02:25:06 UTC

Re: Unable to configure pool with more connections using dbcp2 and EL-2.6.2 - SOLVED

After looking through the dbcp2 source code I discovered that the pool properties need to be prepended by 'jdbc.' So:

jdbc.pool.maxTotal=23
jdbc.pool.maxIdle=-1

Even now that I know this I am unable to find any documentation describing this properties (other than the GenericObjectPoolConfig JavaDoc.


Erwin

> On Dec 21, 2016, at 11:04 AM, Erwin Hogeweg <er...@me.com> wrote:
> 
> 
> All,
> 
> Apologies for cross-posting this from the opsj4 list. Hoping to reach a slightly bigger crowd here.
> 
> The bottom line is that I can’t figure out how to configure more than 8 (anything else than 8 I should say) DB connections. 
> 
> Christian helped me out a while ago setting up a DataSource with mysql, and that works perfectly. However, now I need to increase the connection pool size but I can't figure it out. I tried a bunch of things, following the instructions on the wiki, but to no avail. I always see max. 8 connections in mysql workbench, no matter how many I have configured.
> 
> I this in my datasource config:
> 
> pool.initialSize=11
> pool.maxTotal=23
> 
> and this in my persistence.xml:
> 
> 	<!-- Configure connection pool. -->
> 
> 	<property name="eclipselink.target-database" value="MYSQL" />
> 
> 	<property name="eclipselink.connection-pool.default.initial" value="1" /> 
> 
> 	<property name="eclipselink.connection-pool.default.min" value="64" /> 
> 
> 	<property name="eclipselink.connection-pool.default.max" value="64" /> 
> 
> 
> These are the jdbc bundles:
> id	State       Bundle
> 57	ACTIVE      org.ops4j.pax.jdbc_0.9.0
> 58	ACTIVE      org.ops4j.pax.jdbc.pool.dbcp2_0.9.0
> 59	ACTIVE      org.ops4j.pax.jdbc.config_0.9.0
> 60	ACTIVE      org.ops4j.pax.jdbc.pool.common_0.9.0
> 63	ACTIVE      com.mysql.jdbc_5.1.40
> g! 
> 
> Just FYI - It doesn't make a difference when I include the pax-jdbc-mysql bundle because the com.mysql.jdbc also registers the DSFactories.
> 
> And this is the DataSource service:
> g! services javax.sql.DataSource
> {javax.sql.DataSource}={user=user, osgi.jndi.service.name <http://osgi.jndi.service.name/>=jdbc/mynonjta, dataSourceName=jdbc/mynonjta, databaseName=database, url=jdbc:mysql://my_db_server: <mysql://my_db_server>3306/database, service.pid=org.ops4j.datasource.81aed1e6-e5e3-4398-a67b-2e23b22e96b2, service.factoryPid=org.ops4j.datasource, password=password, pool.maxTotal=23, osgi.jdbc.driver.class=com.mysql.jdbc.Driver-pool, felix.fileinstall.filename=file:/Users/erwin/work/.../org.ops4j.datasource-my.cfg, pool.initialSize=11, service.id <http://service.id/>=139, service.bundleid=59, service.scope=singleton}
>   "Registered by bundle:" org.ops4j.pax.jdbc.config_0.9.0 [59]
>   "Bundles using service"
>     org.apache.aries.jpa.container_2.3.0 [51]
> 
> So everything works perfectly… with 8, and only 8 connections.
> 
> Does anyone see what I am missing?
> 
> As always, your help is greatly appreciated.
> 
> BTW... I am using RESOURCE-LOCAL transaction-type.
> 
> EL-2.6.2
> Equinox-3.10
> Java-8
> MacOS Sierra
> 
> 
> Thanks and Happy Holidays,
> 
> Erwin