From torque-user-return-7368-apmail-db-torque-user-archive=db.apache.org@db.apache.org Wed Jan 10 17:12:13 2007 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 85193 invoked from network); 10 Jan 2007 17:12:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2007 17:12:12 -0000 Received: (qmail 7600 invoked by uid 500); 10 Jan 2007 17:12:19 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 7319 invoked by uid 500); 10 Jan 2007 17:12:18 -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 7232 invoked by uid 99); 10 Jan 2007 17:12:18 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2007 09:12:17 -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 (herse.apache.org: domain of Greg.Monroe@dukece.com designates 152.3.166.24 as permitted sender) Received: from [152.3.166.24] (HELO mail.dukece.com) (152.3.166.24) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2007 09:12:08 -0800 Received: from dukece-mail3.dukece.com ([10.123.20.204]) by mail.dukece.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 10 Jan 2007 12:12:23 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: exception thrown because DB connection not correctly reinited after db server restart Date: Wed, 10 Jan 2007 12:11:42 -0500 Message-ID: <8F5843B903F59D4C8C6806BB49A39119023A51AD@dukece-mail3.dukece.com> In-reply-to: <45A514BD.7060308@idilia.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: exception thrown because DB connection not correctly reinited after db server restart Thread-Index: Acc01MWev2NfpwukSzyXNNqnrB7i+wAAZ9Cw From: "Greg Monroe" To: "Apache Torque Users List" X-OriginalArrivalTime: 10 Jan 2007 17:12:23.0593 (UTC) FILETIME=[7EA9F190:01C734DA] X-Virus-Checked: Checked by ClamAV on apache.org The quick fix is to add the following lines to your=20 init properties: torque.dsfactory.web_test_suite.pool.testOnBorrow=3Dtrue torque.dsfactory.web_test_suite.pool.validationQuery=3DSELECT 1 This will cause the common-dbcp code to verify that any=20 pooled connection is still valid before passing it to Torque. Adds the overhead of a single quick DB query each time a=20 connection is retrieved but it's a small price to pay to make Apps independent of DB restarts. As to the cause... when you say "close the app", do you=20 mean just exist the browser pages or actually stop the=20 webapp on TomCat via the manager/html app? =20 If it's the former, then the webapp / Torque is still active and has pooled connections still open. These pooled=20 connections are a big performance gain since getting a TCP connection to an SQL server is time consuming. But this means that your apps don't behave like the (slower) "open a=20 connection for each page/statement" ones that are common. If it's the latter, then do you have the Torque lib (and=20 support ones) in your common\lib directory and use it across multiple web-apps? Then the reason is that in this situation there is only one pool for all web-apps. =20 Restarting a single webapp will not restart the pool. You have to restart Tomcat (or explicitly shutdown and re-init Torque but that can be problematic...). > -----Original Message----- > From: Eustache [mailto:eustache.felenc@idilia.com]=20 > Sent: Wednesday, January 10, 2007 11:31 AM > To: Apache Torque Users List > Subject: exception thrown because DB connection not correctly=20 > reinited after db server restart >=20 > Hi, I wonder if you can help with the following problem: > I use Tomcat 5.5, postgresql 8.3.1 and Torque. > I first use the webapp using torque everything is ok. I close=20 > the app, a db connection is still there. > Now I reboot db. Try to relaunch the webapp and has this exception in > catalina.out: >=20 > DEBUG org.apache.torque.util.SQLBuilder - SELECT=20 > app_category.CATEGORY_ID, app_category.NAME FROM app_category WHERE > app_category.CATEGORY_ID=3D1028 > org.apache.torque.TorqueException:=20 > org.postgresql.util.PSQLException: An I/O error occured while=20 > sending to the backend. >=20 > [torque.properties] > torque.database.default=3Dweb_test_suite > torque.database.web_test_suite.adapter =3D postgresql=20 > torque.dsfactory.web_test_suite.factory =3D=20 > org.apache.torque.dsfactory.SharedPoolDataSourceFactory > torque.dsfactory.web_test_suite.connection.driver =3D=20 > org.postgresql.Driver=20 > torque.dsfactory.web_test_suite.connection.url =3D=20 > jdbc:postgresql://myserver/mydb=20 > torque.dsfactory.web_test_suite.connection.user =3D myuser=20 > torque.dsfactory.web_test_suite.connection.password =3D >=20 > It seems that torque is not able to get a proper db=20 > connection after the db server is restarted Any clue ? >=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