KB Article #58596
no port available in the pool when using JDBC connector
an error such as below occurs when using the JDBC connector:
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
at com.axway.sfd.CF_ExecOra.execSelectOra(CF_ExecOra.java:42)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.axway.xib.runtime.dml.FunctionContext.execute(FunctionContext.java:56)
at com.axway.xib.runtime.dml.FunctionController.pass(FunctionController.java:279)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
... 6 more
Resolution
If the client has more that 8 processing engines alocated to message processing then it's required to create: CORE_ROOT"/config/java/dbcp.properties" file and put inside a property dbcp.maxActive to specify something greater than the number of processing engines. If the max number of connections is not a problem for the client then he can increase the number anyway to some value and see if this avoids the errors.
If the client is contacting a database via a java custom function, then he must take care to close ResultSet, Statement and Connection instead of letting the system or the garbage collector handling it