Quarkus AS400 DataSource doesn't use all available connections

1.5k views Asked by At

On Quarkus we have configured a default datasource to connect to as400:

quarkus.datasource.driver=com.ibm.as400.access.AS400JDBCDriver
quarkus.datasource.url=jdbc:as400://...
quarkus.datasource.username=xxx
quarkus.datasource.password=xxx
quarkus.datasource.metrics.enabled=true
quarkus.datasource.jdbc.enable-metrics=true
quarkus.datasource.jdbc.leak-detection-interval=10s
quarkus.datasource.jdbc.validation-query-sql=select 1 from sysibm.sysdummy1
quarkus.datasource.max-size=15
quarkus.datasource.min-size=2
quarkus.datasource.initial-size=5
quarkus.datasource.jdbc.pooling-enabled=true

The driver is

<dependency>
  <groupId>net.sf.jt400</groupId>
  <artifactId>jt400</artifactId>
  <version>10.3</version>
</dependency>

It works, but sometimes the connection will be created new also if we have available connections in the pool. When we reach 15 available connections (the pool max size) we got error because agroal cannot get a connection:

Caused by: java.sql.SQLException: Sorry, acquisition timeout!
at io.agroal.pool.ConnectionPool.handlerFromSharedCache(ConnectionPool.java:244)
at io.agroal.pool.ConnectionPool.getConnection(ConnectionPool.java:173)
at io.agroal.pool.DataSource.getConnection(DataSource.java:66)
at org.jdbi.v3.core.Jdbi.open(Jdbi.java:301)
... 80 more

No connection leak detected, the connections are present and available, the problem doesn't occur on the other datasources, they use different drivers (mysql) and we checked that everything is properly closed

Jdk 11 on windows server, quarkus 1.5.0.Final and 1.4.2.Final

0

There are 0 answers