db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew P. Reath" <matt.re...@cciinc.us>
Subject RE: Problems with Mysql timeout
Date Tue, 08 Feb 2005 15:43:51 GMT
Okay didn't send it. I'm including here:

# -------------------------------------------------------------------
# $Id: Torque.properties,v 1.4 2005/02/03 14:31:42 mpreath Exp $
#
# This is the configuration file for Torque.
#
# Note that strings containing "," (comma) characters must backslash
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------

torque.applicationRoot = .

# -------------------------------------------------------------------
#
#  L O G G I N G
#
# -------------------------------------------------------------------
# We use Log4J for all Torque logging and we embed the log4j
# properties within our application configuration.
# -------------------------------------------------------------------

# This first category is required and the category
# must be named 'default'. This is used for all logging
# where an explicit category is not specified.

log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file =
${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c
- %m%n
log4j.appender.org.apache.torque.append = false


# -------------------------------------------------------------------
#
#  T O R Q U E  P R O P E R T I E S
#
# -------------------------------------------------------------------
# These are your database settings. Look in the
# org.apache.torque.pool.* packages for more information.
#
# The parameters to connect to the default database.  You MUST
# configure these properly.
# -------------------------------------------------------------------

torque.database.default=bmc2
torque.database.bmc2.adapter=mysql

## Using commons-dbcp 
torque.dsfactory.bmc2.factory=org.apache.torque.dsfactory.SharedPoolDataSour
ceFactory
#torque.dsfactory.bmc2.factory=org.apache.torque.dsfactory.PerUserPoolDataSo
urceFactory
torque.dsfactory.bmc2.pool.defaultMaxActive=10
torque.dsfactory.bmc2.pool.testOnBorrow=true
torque.dsfactory.bmc2.pool.validationQuery=SELECT 1
torque.dsfactory.bmc2.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.bmc2.connection.url =
jdbc:mysql://localhost/bmc2?autoReconnect=true
torque.dsfactory.bmc2.connection.user = bmc2
torque.dsfactory.bmc2.connection.password =  


## Using jndi
#torque.dsfactory.bmc2.factory=org.apache.torque.dsfactory.JndiDataSourceFac
tory
#torque.dsfactory.bmc2.jndi.path=jdbc/bmc2
#torque.dsfactory.bmc2.jndi.java.naming.factory.initial =
org.apache.naming.java.javaURLContextFactory
#torque.dsfactory.bmc2.jndi.java.naming.factory.url.pkgs = org.apache.naming

#torque.dsfactory.bmc2.datasource.classname=org.apache.torque.pool.TorqueCla
ssicDataSource
#torque.dsfactory.bmc2.datasource.dataSourceName=jdbc/DBbmc2
#torque.dsfactory.bmc2.datasource.jndiEnvironment.java.naming.factory.initia
l = org.apache.naming.java.javaURLContextFactory
#torque.dsfactory.bmc2.datasource.jndiEnvironment.java.naming.factory.url.pk
gs = org.apache.naming
#torque.dsfactory.bmc2.datasource.defaultMaxConnections=10

## ConnectionPoolDataSource
#torque.dsfactory.bmc2.factory=org.apache.torque.dsfactory.JndiDataSourceFac
tory
#torque.dsfactory.bmc2.jndi.path=jdbc/DBbmc2
#torque.dsfactory.bmc2.jndi.java.naming.factory.initial =
org.apache.naming.java.javaURLContextFactory
#torque.dsfactory.bmc2.jndi.java.naming.factory.url.pkgs = org.apache.naming
#torque.dsfactory.bmc2.datasource.classname=org.apache.commons.dbcp.cpdsadap
ter.DriverAdapterCPDS
#torque.dsfactory.bmc2.datasource.driver = org.gjt.mm.mysql.Driver
#torque.dsfactory.bmc2.datasource.url = jdbc:mysql://localhost/bmc2
#torque.dsfactory.bmc2.datasource.user = bmc2
#torque.dsfactory.bmc2.datasource.password = XxUon8sm

# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a highs
# volume.

torque.idbroker.cleverquantity=true

# Determines whether the managers cache instances of the business objects.
# And also whether the MethodResultCache will really cache results.

torque.manager.useCache = true 

-----Original Message-----
From: Matthew P. Reath [mailto:matt.reath@cciinc.us] 
Sent: Tuesday, February 08, 2005 9:43 AM
To: 'Apache Torque Users List'
Subject: RE: Problems with Mysql timeout

 
I've included a copy of my torque properties file. I have autoReconnect set
to true already. I get the following errors in my log:

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

Matt

-----Original Message-----
From: Andras Balogh [mailto:andras@reea.net]
Sent: Tuesday, February 08, 2005 9:13 AM
To: Apache Torque Users List
Subject: Re: Problems with Mysql timeout

Hello,

This is a MySQL related prolbem You must specify autoreconnect=true (or
something like) that at connection properties. You will find this info on
the mysql site, jdbc connection properties.

Best regards,
Andras.

Matthew P. Reath wrote:

>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: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message