From torque-user-return-5807-apmail-db-torque-user-archive=db.apache.org@db.apache.org Fri Feb 18 10:48:32 2005 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 33357 invoked from network); 18 Feb 2005 10:48:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Feb 2005 10:48:32 -0000 Received: (qmail 22919 invoked by uid 500); 18 Feb 2005 10:48:30 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 22529 invoked by uid 500); 18 Feb 2005 10:48:29 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 22515 invoked by uid 99); 18 Feb 2005 10:48:29 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from mxfep02.bredband.com (HELO mxfep02.bredband.com) (195.54.107.73) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 18 Feb 2005 02:48:28 -0800 Received: from [192.168.0.12] ([82.182.38.28] [82.182.38.28]) by mxfep02.bredband.com with ESMTP id <20050218104824.MFH17521.mxfep02.bredband.com@[192.168.0.12]> for ; Fri, 18 Feb 2005 11:48:24 +0100 Received: from 127.0.0.1 (AVG SMTP 7.0.300 [265.8.8]); Fri, 18 Feb 2005 11:49:48 +0100 Message-ID: <4215C84B.4050103@polyester.se> Date: Fri, 18 Feb 2005 11:49:47 +0100 From: Christian Bach User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: torque-user@db.apache.org Subject: Torque + SharedPoolDataSourceFactory + Mysql problems Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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