I have a web application that runs in Tomcat, it connects to a Oracle DB through a DataSource. I've been dealing with some weird behavor, because the connection pool gets full even if there are no users connected and as soon as the application starts! When I check the queries that are being executed it always appears to be the same:
select value$ from props$ where name = 'global_db_name'
The context for the Connection is this:
<Context antiResourceLocking="true" crossContext="true" path="/taquillas">
<Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
jmxEnabled="true" url="jdbc:oracle:thin:@yyy.yyy.yyy.yyy:zzzz:ANNI"
username="xxxxxxxxx" name="jdbc/andrea" password="xxxxxxx"
type="javax.sql.DataSource" validationInterval="30000"
maxActive="50" minIdle="1" maxWait="10000" defaultAutoCommit="false"
initialSize="1" removeAbandonedTimeout="60"
removeAbandoned="true" validationQuery="SELECT 1 FROM DUAL"/>
</Context>
And the DataSource is like this:
public dbutilsHandler()
throws ClassNotFoundException, SQLException, NamingException {
this.gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd")
.serializeNulls().create();
InitialContext cxt;
cxt = new InitialContext();
this.ds = (DataSource) cxt.lookup("java:/comp/env/jdbc/andrea");
this.query = new QueryRunner(ds);
this.con = this.query.getDataSource().getConnection();
}
I'm making sure that no connections are left open but I still don't understand why is happening. Help!