I added those to the properties file but get the following errors in
the log
files:
ERROR http-8080-Processor25
org.apache.torque.dsfactory.AbstractDataSourceFactory - Property:
timeBetweenEvictionRunsMillis value: 10000 is not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR http-8080-Processor25
org.apache.torque.dsfactory.AbstractDataSourceFactory - Property:
minEvictableIdleTimeMillis value: 10000 is not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR http-8080-Processor25
org.apache.torque.dsfactory.AbstractDataSourceFactory - Property:
defaultMaxActive value: 10 is not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR http-8080-Processor25
org.apache.torque.dsfactory.AbstractDataSourceFactory - Property:
testOnBorrow value: true is not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR http-8080-Processor25
org.apache.torque.dsfactory.AbstractDataSourceFactory - Property:
validationQuery value: SELECT 1 is not supported by DataSource:
org.apache.commons.dbcp.datasources.SharedPoolDataSource
Any suggestions?
Matt
-----Original Message-----
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 08, 2005 9:53 AM
To: Apache Torque Users List
Subject: RE: Problems with Mysql timeout
Hi,
Yet another solution on the client side: Whether a connection timeout
can be configured depends on the connection pool you are using. If you
are using SharedPoolDataSource, it should be possible to tell the pool
to close unused connections after a certain period of time. See the
documentation of the setters in
http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/
datas
ources/SharedPoolDataSource.html
All of the setters can be addressed by setting the corresponding
properties in the Torque runtime.
The setters you need should be
http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/
datas
ources/InstanceKeyDataSource.html#setTimeBetweenEvictionRunsMillis(int)
and
http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/
datas
ources/InstanceKeyDataSource.html#setMinEvictableIdleTimeMillis(int)
The corresponding properties are e.g. (replace somedb with your db
name) torque.dsfactory.somedb.pool.timeBetweenEvictionRunsMillis =
10000 torque.dsfactory.somedb.pool.minEvictableIdleTimeMillis = 100000
Thomas
"Matthew P. Reath" <[EMAIL PROTECTED]> schrieb am 08.02.2005 16:07:49:
I'm developing a web-based application using Tomcat/Torque/MySQL. The
problem I run into is that after 8 hours of inactivity the persistent
connection Torque uses becomes invalid and I get an exception. The
next
time
I try it works. After another 8 hours of idle time the process repeats.
I searched the internet for answers but most of them involved good
programming practice to handle this situation in one's own JDBC code,
I however am using Torque.
Is there a way to configure Torque to handle this timeout period? I'd
rather
not depend on the connection always being there in case it was dropped
because of network problems or what not. Ideally I would like Torque
to reconnect anytime it's connection becomes invalid or do some sort
of heartbeat.
Thanks,
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]