Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 47694 invoked from network); 1 Feb 2006 19:52:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Feb 2006 19:52:53 -0000 Received: (qmail 3234 invoked by uid 500); 1 Feb 2006 19:52:51 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 3220 invoked by uid 500); 1 Feb 2006 19:52:51 -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 3209 invoked by uid 99); 1 Feb 2006 19:52:50 -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:52:50 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of Greg.Monroe@dukece.com designates 65.112.55.73 as permitted sender) Received: from [65.112.55.73] (HELO mail.dukece.com) (65.112.55.73) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 11:52:49 -0800 Received: from dukece-mail3.dukece.com ([192.168.1.222]) by mail.dukece.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 1 Feb 2006 14:52:37 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Content-Class: urn:content-classes:message Subject: RE: Pooled Connections Question - V 3.2 RC-2 -= Java/DB2 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Wed, 1 Feb 2006 14:52:27 -0500 Message-ID: <8F5843B903F59D4C8C6806BB49A3911906297F@dukece-mail3.dukece.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Pooled Connections Question - V 3.2 RC-2 -= Java/DB2 Thread-Index: AcYnZI3xG1Beo8yXQIiIP1phJWFY0AAAvGCg From: "Greg Monroe" To: "Apache Torque Users List" X-OriginalArrivalTime: 01 Feb 2006 19:52:37.0671 (UTC) FILETIME=[0D699370:01C62769] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N According to the JDBC 3.0 specs, rollbacks shouldn't close a connection. When I checked the Spec pdf quickly, I saw it=20 has some examples of using connections after a rollback call=20 in the text describing what rollback and savepoints do. With a pool, you definitely need to do an explicit close. This doesn't really close the connection, just makes it=20 available for others to use. Garbage collection of=20 unclosed PoolConnections should release the connection back to the pool, but that may take a fair amount of time. > -----Original Message----- > From: Jim Caserta [mailto:smoothie_jc@yahoo.com]=20 > Sent: Wednesday, February 01, 2006 2:20 PM > To: Apache Torque Users List > Subject: RE: Pooled Connections Question - V 3.2 RC-2 -=3D Java/DB2 >=20 >=20 > Greg, >=20 > I do have > torque.dsfactory.eMarine.pool.testOnBorrow=3Dtrue > torque.dsfactory.eMarine.pool.validationQuery=3DSELECT 1 > But I did not list all of the properties.. I believe > the con.rollback will close the connection?? >=20 > Thanks! > Jim >=20 > --- Greg Monroe wrote: >=20 > > 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. > >=20 > > These are set by the command line parameters of: > >=20 > > -Xms Initial heap size > > -Xmx Maximum heap size > >=20 > > E.g: JVM -Xms512m -Xmx1024m ... > >=20 > > 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. > >=20 > > 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=20 > > server connectors elements in the server.xml. The > > issue > > I'm remembering might have been related to there not > >=20 > > being enough threads available when pool asked for > > one. > >=20 > > Another though is that you might add the following > > to > > your torque properties: > >=20 > > torque.dsfactory.eMarine.pool.testOnBorrow=3Dtrue > > torque.dsfactory.eMarine.pool.validationQuery=3DSELECT > > 1 > >=20 > > 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.=20 > > The pooling software will then create a new > > connection > > object for you. > >=20 > > 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=20 > > actions using the same connection. You should always > >=20 > > 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. > >=20 > > 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. > >=20 > >=20 > > > -----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 -=3D Java/DB2 > > >=20 > > >=20 > > > When you say the "maximum memory pool", you are > > > refering to the "pool.maxActive" number.. correct? > > >=20 > > > 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.. > > >=20 > > > Thanks! > > >=20 > > > --- Greg Monroe wrote: > > >=20 > > > > 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). > > > >=20 > > > > But then again, my neural net sometimes makes > > the > > > > wrong connections as I get older. > > > >=20 > > > > > -----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 > > > > -=3D Java/DB2 > > > > >=20 > > > > >=20 > > > > > Hi all, > > > > >=20 > > > > > 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 > > > > > =20 > > > > > Occasionally we also find that a connection > > does > > > > not > > > > > close after a commit. Our code is basic.. > > > > >=20 > > > > > con =3D > > > > Torque.getConnection(db2.torque.environment)); > > > > > //do stuff > > > > > con.commit(); > > > > > }finally { > > > > > if (con !=3D null) { //this is prob never null > > > > > if (!con.isClosed()) { > > > > > // send a message the con is NOT > > closed > > > > > Torque.closeConnection(con); } > > > > >=20 > > > > > Here is a portion of the prop file: > > > > > > > > > > > > > > > torque.dsfactory.eMarine.factory=3Dorg.apache.torque.dsfactory.S > > > > > haredPoolDataSourceFactory > > > > > torque.dsfactory.eMarine.connection.driver =3D=20 > > > > > COM.ibm.db2.jdbc.app.DB2Driver > > > > >=20 > > > > > torque.defaults.pool.initialSize =3D 1=20 > > > > > torque.defaults.pool.maxIdle =3D 40 > > > > torque.defaults.pool.maxActive =3D 60 > > > > >=20 > > > > > torque.defaults.pool.maxWait =3D 50000 > > > > > > > > > > > torque.defaults.pool.timeBetweenEvictionRunsMillis=3D > > > > > 200000 > > > > > > > torque.defaults.pool.minEvictableIdleTimeMillis =3D > > > > > 2000000 > > > > > torque.defaults.connection.driver =3D=20 > > > > > COM.ibm.db2.jdbc.app.DB2Driver > > > > torque.idbroker.clever.quantity=3Dtrue > > > > > torque.manager.useCache =3D true > > > > torque.database.eMarine.adapter=3Ddb2app > > > > > torque.defaults.connection.driver =3D=20 > > > > > COM.ibm.db2.jdbc.app.DB2Driver > > > > torque.defaults.connection.url > > > > > =3D jdbc:db2:DB2B > > > > >=20 > > > > >=20 > > > > > Does anything jump out that might be set > > wrong? > > > > >=20 > > > > > Thank you for any help! > > > > > Jim > > > > >=20 > > > > >=20 > > > > >=20 > > > > > =20 > > > > >=20 > > > > > > > __________________________________________________ > > > > > Do You Yahoo!? > > > > > Tired of spam? Yahoo! Mail has the best spam > > > > protection around > > > > > http://mail.yahoo.com > > > > >=20 > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: > > > > torque-user-unsubscribe@db.apache.org > > > > > For additional commands, e-mail: > >=20 > =3D=3D=3D message truncated =3D=3D=3D >=20 >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around=20 > http://mail.yahoo.com=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org >=20 >=20 Duke CE Privacy Statement Please be advised that this e-mail and any files transmitted with it are = confidential communication or may otherwise be privileged or = confidential and are intended solely for the individual or entity to = whom they are addressed. If you are not the intended recipient you may = not rely on the contents of this email or any attachments, and we ask = that you please not read, copy or retransmit this communication, but = reply to the sender and destroy the email, its contents, and all copies = thereof immediately. Any unauthorized dissemination, distribution or = copying of this communication is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org