We are facing a problem that the number of connections made to the database explodes during restarts of Tomcat 7.
Our configurations are below, set on Tomcat's context.xml:
<Resource auth="Container"
driverClassName="oracle.jdbc.driver.OracleDriver"
initialSize="1"
maxActive="10"
maxAge="600000"
maxIdle="5"
maxOpenPreparedStatements="200"
maxWait="10000"
minEvictableIdleTimeMillis="60000"
minIdle="0"
name="jdbc/backoffice"
password="backoffice"
poolPreparedStatements="true"
rollbackOnReturn="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="6000000"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@127.0.0.1:1521:DATABASE"
username="backoffice"
validationQuery="SELECT SYSDATE FROM DUAL"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
/>
After a restart of Tomcat, the opened connections number gets close to 700. A redeploy of the war (rename to ".war_bk" e rename back to ".war") resolves the problem.
Why this is happening? What can we do differently?