[opencms-dev] how to set "idle timeout" or close idled connections of connection pool?

ark-d at betasystems.com ark-d at betasystems.com
Fri Apr 22 09:14:13 CEST 2005





Dear All,

I have the following problem:

I have installed opencms (alpha3) on tomcat behind the firewall in DMZ and
the database is living peaceably in our LAN.
Between our LAN and DMZ we have a firewall which cuts / blocks the
connection between opencms and the database after 2 hours of idle time
(that means only if no activities can be recognized by the firewall after
this time, the connection will be destroyed or blocked). After that MySQL
does close the idle connections, but opencms / tomcat doesn't close them.
Now if I try to connect to the workplace or any public page, nothing
happens, because we think that opencms trys to establish the old
connections / sockets, which doesn't exist anymore on the database side and
I don't get any timeout or warnings, nothing can be logged into opencms.log
too.

So every sunny morning we have to restart tomcat and begin to work with
opencms.

In opencms.properties I have tryed to set db.pool.default.testOnBorrow to
true, like this:

# connections will be validated before they are borrowed from the pool
db.pool.default.testOnBorrow=true

because I thought that perhaps opencms could validate the connections and
if they don't exist anymore, it trys to setup new connections.
But this didn't work for us unfortunately.

The workaround which I'm trying now is to send every hour one request to
the index page via JMeter, so the firewall thinks we are hard-working over
the night studiously and says you are good boys, so I let you to work
tomorrow too withought to have to awake your (Tom- ) cat , it seems to work
:-)

But I would like to find the reason exactly or a possible solution,

so now my questions are:

is there any way to set an "idle timeout" in opencms or tomcat, so that
idle connections could be closed for instance after 1 hour?

who is responsible or able to close idle connections, tomcat or opencms?

could a croned job, which will send a request every 1 hour to the database
from opencms be a possible solution?

do you have other ideas?

thank you for possible hints,

Best Regards,
Arash Kaffamanesh

P.S:

By the way I'm working on Suse Linux 9 (sles9 kernel 2.6) with Suse Tomcat
5.0.19, Apache 2.0.49, and mysql 4.0.18




More information about the opencms-dev mailing list