Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 32062 invoked from network); 1 Feb 2006 19:20:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Feb 2006 19:20:27 -0000 Received: (qmail 51298 invoked by uid 500); 1 Feb 2006 19:20:24 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 51281 invoked by uid 500); 1 Feb 2006 19:20:23 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 51270 invoked by uid 99); 1 Feb 2006 19:20:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 11:20:23 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.142.206.33] (HELO web32803.mail.mud.yahoo.com) (68.142.206.33) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 01 Feb 2006 11:20:23 -0800 Received: (qmail 60073 invoked by uid 60001); 1 Feb 2006 19:20:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=jOS93lvOBM3A5GqqxVUKX1SiiskBh8AR9FY1HvJ2o930di7gObwm2UHxxSKd/MgQ2n0oOQkMPbZwMpvJv31Gz3FbR51tZDyYzsYoCaxewpvWTnaxl3+bXZ1mCYS7IHULY165mhVb1jXJlStFgCymHVcHXKFtyQhDoBsMWCKckwk= ; Message-ID: <20060201192001.60024.qmail@web32803.mail.mud.yahoo.com> Received: from [12.20.43.1] by web32803.mail.mud.yahoo.com via HTTP; Wed, 01 Feb 2006 11:20:00 PST Date: Wed, 1 Feb 2006 11:20:00 -0800 (PST) From: Jim Caserta Subject: RE: Pooled Connections Question - V 3.2 RC-2 -= Java/DB2 To: Apache Torque Users List In-Reply-To: <8F5843B903F59D4C8C6806BB49A3911906297B@dukece-mail3.dukece.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Greg, I do have torque.dsfactory.eMarine.pool.testOnBorrow=true torque.dsfactory.eMarine.pool.validationQuery=SELECT 1 But I did not list all of the properties.. I believe the con.rollback will close the connection?? Thanks! Jim --- Greg Monroe wrote: > These are not Torque settings but Java Virtual > Machine > settings. The Sun defaults are kind of small and > for > any large active application, you need to increase > them > by starting your Java VM with larger values. > > These are set by the command line parameters of: > > -Xms Initial heap size > -Xmx Maximum heap size > > E.g: JVM -Xms512m -Xmx1024m ... > > Most environments have a way to set or add JVM > parameters, > for example Tomcat 5, has a nice monitor/config tool > that lets you set this in a gui. Older versions had > an > environment variable you could set. > > Going back thru my load testing notes (from a year > ago), > I also logged that we needed to increase the number > of > threads the server could handle on the Tomcat web > server connectors elements in the server.xml. The > issue > I'm remembering might have been related to there not > > being enough threads available when pool asked for > one. > > Another though is that you might add the following > to > your torque properties: > > torque.dsfactory.eMarine.pool.testOnBorrow=true > torque.dsfactory.eMarine.pool.validationQuery=SELECT > 1 > > This will add a little overhead, i.e. SELECT 1 query > before each pool checkout. But it will catch any > connections > that have timed out at the server end or were > established > in the pool prior to the DB server being restarted. > The pooling software will then create a new > connection > object for you. > > Re - Closing connections. A connection.commit() > should > not close a connection. It is only a transaction > commit > action. You may still want to use it to do more db > actions using the same connection. You should always > > close any connections to return them to the pool. > FWIW, > I believe that a close will also force a commit, but > that > would be jdbc driver specific. To be safe, do a > commit > then close. > > Also, you might want to consider using Torque's > Transaction > class instead of getting connections directly. This > has > some logic that handle various DB specific > transaction > oddities. This would make your code more portable. > > > > -----Original Message----- > > From: Jim Caserta [mailto:smoothie_jc@yahoo.com] > > Sent: Wednesday, February 01, 2006 8:31 AM > > To: Apache Torque Users List > > Subject: RE: Pooled Connections Question - V 3.2 > RC-2 -= Java/DB2 > > > > > > When you say the "maximum memory pool", you are > > refering to the "pool.maxActive" number.. correct? > > > > And leave the "maxidle" where it is? I'm a little > > fuzzy on how the maxidle affects how many > connections > > are available in the pool.. > > > > Thanks! > > > > --- Greg Monroe wrote: > > > > > I seem to remember getting this error when load > > > testing an application. I think the solution > was > > > to bump up the JVM initial memory pool and > > > maximum memory pool (good thing to do by > default). > > > > > > But then again, my neural net sometimes makes > the > > > wrong connections as I get older. > > > > > > > -----Original Message----- > > > > From: Jim Caserta > [mailto:smoothie_jc@yahoo.com] > > > > Sent: Tuesday, January 31, 2006 8:25 AM > > > > To: Apache Torque Users List > > > > Subject: Pooled Connections Question - V 3.2 > RC-2 > > > -= Java/DB2 > > > > > > > > > > > > Hi all, > > > > > > > > Occasionally we receive the following > connection > > > error > > > > message: Torque Exception Message: . Error > > > Message > > > > is: > org.apache.commons.dbcp.SQLNestedException: > > > Could > > > > not retrieve connection info from pool > > > > > > > > Occasionally we also find that a connection > does > > > not > > > > close after a commit. Our code is basic.. > > > > > > > > con = > > > Torque.getConnection(db2.torque.environment)); > > > > //do stuff > > > > con.commit(); > > > > }finally { > > > > if (con != null) { //this is prob never null > > > > if (!con.isClosed()) { > > > > // send a message the con is NOT > closed > > > > Torque.closeConnection(con); } > > > > > > > > Here is a portion of the prop file: > > > > > > > > > > torque.dsfactory.eMarine.factory=org.apache.torque.dsfactory.S > > > > haredPoolDataSourceFactory > > > > torque.dsfactory.eMarine.connection.driver = > > > > COM.ibm.db2.jdbc.app.DB2Driver > > > > > > > > torque.defaults.pool.initialSize = 1 > > > > torque.defaults.pool.maxIdle = 40 > > > torque.defaults.pool.maxActive = 60 > > > > > > > > torque.defaults.pool.maxWait = 50000 > > > > > > > > torque.defaults.pool.timeBetweenEvictionRunsMillis= > > > > 200000 > > > > > torque.defaults.pool.minEvictableIdleTimeMillis = > > > > 2000000 > > > > torque.defaults.connection.driver = > > > > COM.ibm.db2.jdbc.app.DB2Driver > > > torque.idbroker.clever.quantity=true > > > > torque.manager.useCache = true > > > torque.database.eMarine.adapter=db2app > > > > torque.defaults.connection.driver = > > > > COM.ibm.db2.jdbc.app.DB2Driver > > > torque.defaults.connection.url > > > > = jdbc:db2:DB2B > > > > > > > > > > > > Does anything jump out that might be set > wrong? > > > > > > > > Thank you for any help! > > > > Jim > > > > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > > > > Do You Yahoo!? > > > > Tired of spam? Yahoo! Mail has the best spam > > > protection around > > > > http://mail.yahoo.com > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > > > torque-user-unsubscribe@db.apache.org > > > > For additional commands, e-mail: > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org