Hi Michael, see inline
Holly, Michael wrote:
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.
config removed
My problem is that there is a firewall between the DB and my tomcatyes, you can combine multiple test* parameters
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?
The testWhileIdle alone will solve your problem, the firewall sees the test query and will not close the connection. The minEvictableIdleTimeMillis is optional but you have to configure timeBetweenEvictionRunsMillis and numTestsPerEvictionRun.2. Will utitlizing the 'testWhileIdle' and a 'timeBetweenEvictionRunsMillis' = 600000 (10min) and a 'minEvictableIdleTimeMillis' = 1800000 (30 min) solve my problem?
It you set maxIdle=0 then no connection will be allowed to remain idle in the pool. (idle meaning not active, not being used by the application). This effectively disables the pooling as all connections are closed immediately.3. Could I set the 'MaxIdle' parameter down to 0 so that all connections are eventually dropped from inactivity?
There is also another solution.
You can prevent that your firewall from dropping the connection using a oracle technique.
SQL*Net has a parameter which defines time interval to send a probe message to identify if the client process is still alive
- SQLNET.EXPIRE_TIME, sqlnet.ora file on the server side. SQLNET.EXPIRE_TIME = <your_value>
Set it to something like 30 when your firewall drops connection after 60 minutes.
See: http://download-west.oracle.com/docs/cd/A87860_01/doc/network.817/a76933/params.htm#437583
We use this in our server environment and it works perfectly.
-- Dirk
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
