We are running Tomcat 9 Java 11 on Kubernetes. When the applications loses the ability to get to the database (network issue, firewall etc), it is taking 4 and half minutes to finally timeout and give this error:
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
I have the login timeout set to 30 seconds on the actual database calls when it gets the datasource, but it is ignored. I guess since it can't get to the database over the network (we have it blocked in firewall to debug this issue so we can figure out where the timeout issue is)
We have the pool set as:
<Resource name="jdbc/appDS" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
username="DB_USER"
password="DB_PASS"
url="jdbc:oracle:thin:@DB_URL"
initialSize="0"
maxIdle="10"
minIdle="10"
maxTotal="100"
removeAbandonedOnBorrow="true"
validationQuery="select 1 from dual"
validationQueryTimeout="20"
maxWait="30000"
logAbandoned="true"
testOnConnect="true"
testWhileIdle="true"
testOnBorrow="true"
/>