I'm workin on an application deployed on karaf 4.2.9 and I'm 
using org.ops4j.pax.jdbc-1.4.4.

I've installed 
pax-jdbc-mariadb
pax-jdbc-pool-dbcp2
pax-jdbc-spec
pax-jdbc-config


I have a xa datasource for mariadb with this configuration:

osgi.jdbc.driver.name=mariadb
url=jdbc:mariadb://dbprimary:3306/gg_caibizdata?autoReconnect=true
user= xxxxxx
password=xxxxxx
dataSourceName=caibizdata
pool=dbcp2
jdbc.pool.maxTotal=100
jdbc.pool.maxIdle=7
jdbc.pool.maxWaitMillis=10000
xa=true
jdbc.factory.validationQuery="/* ping */ SELECT 1"

When karaf starts it doesn't create the connection, only when used for the 
first time using ds-list or by some bundle the connection is instantiated.
After some time, when every connection goes idle no other connection is 
created and if a bundle try to get a connection it receives a connection 
timeout, then if it tries another time everything goes well.
I've tried to set a minimum number of connections, bat i'ven't found the 
right property.
I've also tried to change the configuration using something like this

osgi.jdbc.driver.name=mariadb
url=jdbc:mariadb://dbprimary:3306/gg_caibizdata?autoReconnect=true
user=xxxxxxx
password=xxxxxx
dataSourceName=caibizdata
pool=dbcp2
pool.maxTotal=100
pool.minIdle=10
pool.maxWaitMillis=2000
pool.blockWhenExhausted = true
pool.testOnBorrow = true
pool.testWhileIdle = false
pool.timeBetweenEvictionRunsMillis = 120000
pool.evictionPolicyClassName = 
org.apache.commons.pool2.impl.DefaultEvictionPolicy
xa=true
jdbc.factory.validationQuery="/* ping */ SELECT 1"
jdbc.factory.maxConnLifetimeMillis = 30000
jdbc.factory.validationQueryTimeout = 2000
 
but nothing changes , and if I set both validationQUery and testOnBorrow 
the system could not create the connection.

What I'm doing wrong, can anyone help me?

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ops4j/d0e5451b-ee8c-4642-be82-ff3210ec766cn%40googlegroups.com.

Reply via email to