Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2060440A2 for ; Sun, 3 Jul 2011 19:27:47 +0000 (UTC) Received: (qmail 3714 invoked by uid 500); 3 Jul 2011 19:27:47 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 3686 invoked by uid 500); 3 Jul 2011 19:27:46 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 3463 invoked by uid 99); 3 Jul 2011 19:27:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2011 19:27:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2011 19:27:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id EF10844342C for ; Sun, 3 Jul 2011 19:27:21 +0000 (UTC) Date: Sun, 3 Jul 2011 19:27:21 +0000 (UTC) From: "Thomas Fox (JIRA)" To: torque-dev@db.apache.org Message-ID: <503457967.1041.1309721241976.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (TORQUE-111) Thrown RuntimeExceptions cause database connections to remain open MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/TORQUE-111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Fox resolved TORQUE-111. ------------------------------- Resolution: Fixed Fix Version/s: 4.0 Assignee: Thomas Fox Caching Exceptions is not pretty because the exception should be rethrown and the mewthod should still only throw a TorqueException. Using a try..finally block is more elegant. > Thrown RuntimeExceptions cause database connections to remain open > ------------------------------------------------------------------ > > Key: TORQUE-111 > URL: https://issues.apache.org/jira/browse/TORQUE-111 > Project: Torque > Issue Type: Bug > Components: Runtime > Affects Versions: 3.2, 3.3 > Reporter: Neil Weber > Assignee: Thomas Fox > Priority: Critical > Fix For: 4.0 > > Original Estimate: 0.25h > Remaining Estimate: 0.25h > > In the doSelect(), doDelete(), doInsert(), and doUpdate() methods in BasePeer a database connection is obtained, some work performed, and then, if successful, the work is committed and the database connection is closed. If a TorqueException is thrown while performing the work, the work is rolled back and the database connection is closed. If a RuntimeException is thrown while performing the work, the work is *not* rolled back and the database connection remains open. > The fix is simple: catch Exception (or Throwable) instead of TorqueException. This will ensure that, no matter what the problem is, Torque ensures the database connection is closed. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org