You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Christian Bach <ch...@polyester.se> on 2005/02/18 11:49:47 UTC

Torque + SharedPoolDataSourceFactory + Mysql problems

Hi,

Where running an app on tomcat built with Turbine and Torque and with a 
Mysql database.

Where using the SharedPoolDataSourceFactory to manage the connection 
pool to the database.
And there seems to be a problem on how this is beeing used, after 
uppgrading to Torque 3.1.1
the app would only run for aprox 5 minutes and then it would "stall". 
The problem seemed to be
that the pool was not being reused. This was with the testOnBorrow 
option enabled.

What sorted our problem out was using the minEvictableIdleTimeMillis 
option, now the app
has been up and running for servral days but it seems that some times i 
can take up to 40sec to
access the app if now current connection to the database is open.
Wich is a bit strange when our Mysql database shows that there are 5 
idle connection.
And Torque still wants to open a new one and disgards the old.

Any ides?

Best regards
Christian Bach

Our setup:
Turbine-2.3.1
Torque-3.1.1
Tomcat-5.0.29
J2sdk1.4.2_05
Mysql-4.0.23a

Our libs:
avalon-framework-4.1.4.jar           
commons-beanutils-1.6.1.jar          
commons-codec-1.1.jar                
commons-collections-3.0.jar          
commons-configuration-1.0.jar        
commons-dbcp-1.2.1.jar               
commons-digester-1.5.jar             
commons-email-20030310.165926.jar    
commons-fileupload-1.0.jar           
commons-lang-2.0.jar                 
commons-logging-api.jar              
commons-logging.jar                  
commons-pool-1.2.jar                 
cryptix-3.2.0.jar                    
dom4j-1.4.jar                        
ecs-1.4.2.jar                        
excalibur-component-1.1.jar          
excalibur-instrument-1.0.jar         
excalibur-logger-1.0.1.jar           
excalibur-pool-1.2.jar                                      
hsqldb-1.7.1.jar                     
javamail-1.3.1.jar                   
jcs-20030822.182132.jar              
jdbc-2.0.jar                         
jndi-1.2.1.jar                       
junit-3.8.1.jar                      
jython-2.1.jar                       
log4j-1.2.8.jar                      
logkit-1.0.1.jar                     
mysql-connector-java-3.0.16-ga-bin.jar
oro-2.0.7.jar                        
stratum-1.0-b5.jar                   
torque-3.1.1.jar                     
turbine-2.3.1.jar                    
velocity-1.3.1.jar                   
village-2.0-dev-20030825.jar         
web-app_2_3.dtd                      
xalan-2.5.1.jar                      
xercesImpl-2.4.0.jar                 
xml-apis-1.0.b2.jar                  
xmlrpc-1.2-b1.jar   

Here is our Torqe.properties.

# -------------------------------------------------------------------
# $Id: Torque.properties,v 1.17 2005/01/10 19:25:03 cvs 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.
# -------------------------------------------------------------------
# 2004-03-04: This should be configured from Log4j.properties.

# 2003-12-01:
torque.addIntakeRetrievable = true
torque.retrievableInterface = org.apache.turbine.om.Retrievable

# -------------------------------------------------------------------
#
#  D E F A U L T S
#
# -------------------------------------------------------------------
#
# These values kick in, if you don't explicitly override them in your
# various database settings. At the moment they're only used if you
# configure the TorqueDataSourceFactory of the Jdbc2PoolDataSourceFactory
# as your data source provider. It does not work with JNDI.
#
# The example is shown for TorqueDataSource.
#
# -------------------------------------------------------------------

torque.defaults.connection.driver = com.mysql.jdbc.Driver

#torque.defaults.pool.testOnBorrow=true
#torque.defaults.pool.validationQuery=SELECT 1
torque.defaults.pool.maxActive=15
torque.defaults.pool.timeBetweenEvictionRunsMillis = 60000
torque.defaults.pool.minEvictableIdleTimeMillis = 600000
torque.defaults.pool.maxWait = 500
torque.defaults.pool.maxIdle = 5

# Sets the URL for the datasources
torque.defaults.connection.url = 
jdbc:mysql://localhost:3306/polyshop?autoReconnect=true

# Sets login and password for the data sources.
torque.defaults.connection.user = *********
torque.defaults.connection.password = *********


# -------------------------------------------------------------------
#
#  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 = polyshop

torque.database.polyshop.adapter=mysql

torque.dsfactory.polyshop.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory

#torque.dsfactory.polyshop.pool.testOnBorrow = true
#torque.dsfactory.polyshop.pool.validationQuery = SELECT 1
torque.dsfactory.polyshop.pool.maxActive = 15
torque.dsfactory.polyshop.pool.maxWait = 500
torque.dsfactory.polyshop.pool.maxIdle = 5
torque.dsfactory.polyshop.pool.timeBetweenEvictionRunsMillis = 60000
torque.dsfactory.polyshop.pool.minEvictableIdleTimeMillis = 600000

torque.dsfactory.polyshop.connection.driver = com.mysql.jdbc.Driver
torque.dsfactory.polyshop.connection.url = 
jdbc:mysql://localhost:3306/polyshop?autoReconnect=true
torque.dsfactory.polyshop.connection.user = *********
torque.dsfactory.polyshop.connection.password = *********

# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# 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 = false

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