Hi Grzegorz, thanks for your reply, I'll try narayana, but I,m curious to know why the system has this strange behaviour.
Luigi Il giorno mer 16 set 2020 alle ore 16:23 Grzegorz Grzybek < [email protected]> ha scritto: > Hello > > InitialSize was introduced in https://ops4j1.jira.com/browse/PAXJDBC-146, > but only for pax-jdbc-pool-narayana. Looks like plain dbcp2 pool doesn't > have this support... > > regards > Grzegorz Grzybek > > śr., 16 wrz 2020 o 16:14 Luigi Caligiuri <[email protected]> > napisał(a): > >> 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 >> <https://groups.google.com/d/msgid/ops4j/d0e5451b-ee8c-4642-be82-ff3210ec766cn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > You received this message because you are subscribed to a topic in the > Google Groups "OPS4J" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ops4j/PQxwctv8PYg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ops4j/CAAdXmhrsO3W1JCX05o%2BEwg7-NhFicurDXaYtgQoBoAUHTjtv-A%40mail.gmail.com > <https://groups.google.com/d/msgid/ops4j/CAAdXmhrsO3W1JCX05o%2BEwg7-NhFicurDXaYtgQoBoAUHTjtv-A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- -- ------------------ 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/CAM4qgtpFVzoBTwOBaePSFweJFd2iUVJyTqn_4zdaXZhp4rdWCw%40mail.gmail.com.
