Hi
I'm using JDK 1.4.1_06 on Solaris 9. My application is run on Tomcat
4.1.24 and makes connections to a MySQL 3.23.53 db and an Oracle 8i DB
via the DBCP 1.0.
I have had excellent performanace using DBCP but on this project I am
hitting a snag. I use the following configuration for my oracle DB
connection pool.
<Resource name="jdbc/oracle_abraxxas" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/oracle_abraxxas">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = snooker.myco.com)(PORT = 1521)))
(CONNECT_DATA = (SERVER = DEDICATED) (SID = ABRAXXAS)))</value>
</parameter>
<parameter>
<name>username</name>
<value>abraxxas</value>
</parameter>
<parameter>
<name>password</name>
<value>#########</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>300</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select 'validationQuery' from dual</value>
</parameter>
<parameter>
<name>testOnBorrow</name>
<value>true</value>
</parameter>
</ResourceParams>
My problem is that there is a firewall between the DB and my tomcat
server. On the production system firewall connections have 60 min TTL.
Right now when I come in the morning and run the page that performs the
query to the Oracle DB it hangs. Eventually, the page times out.
My questions are:
1. Can I utilize a 'testOnBorrow' parameter and a 'testWhileIdle'
parameter at the same time?
2. Will utitlizing the 'testWhileIdle' and a
'timeBetweenEvictionRunsMillis' = 600000 (10min) and a
'minEvictableIdleTimeMillis' = 1800000 (30 min) solve my problem?
3. Could I set the 'MaxIdle' parameter down to 0 so that all connections
are eventually dropped from inactivity?
I do not have the same network configuration in my Test otherwise I
would just test it there.
Thanks for the help
Michael