Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C38E51118B for ; Thu, 22 May 2014 12:18:02 +0000 (UTC) Received: (qmail 50661 invoked by uid 500); 22 May 2014 12:18:02 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 50558 invoked by uid 500); 22 May 2014 12:18:02 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 50525 invoked by uid 99); 22 May 2014 12:18:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 12:18:02 +0000 Date: Thu, 22 May 2014 12:18:01 +0000 (UTC) From: "Bjorn Vidar Remme (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DBCP-420) InstanceKeyDataSource discards native SQLException when given password does not match password used to create the connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DBCP-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bjorn Vidar Remme updated DBCP-420: ----------------------------------- Attachment: dbcp_420_patch.txt Attached a possible patch w/tests. Only the 'testConnectingForUserWithExistingConnectionWhenPasswordMismatchThrowsNestedSQLExceptionIfNewPasswordNotValid' test is needed for this patch. Added two more tests that verify the other cases and they work as intended. No code changed needed in the code to make those pass. > InstanceKeyDataSource discards native SQLException when given password does not match password used to create the connection > ---------------------------------------------------------------------------------------------------------------------------- > > Key: DBCP-420 > URL: https://issues.apache.org/jira/browse/DBCP-420 > Project: Commons Dbcp > Issue Type: Bug > Affects Versions: 2.0 > Reporter: Bjorn Vidar Remme > Attachments: dbcp_420_patch.txt > > > The throw in InstanceKeyDataSource at line 936 does not pass on the native SQL exception from the connection test: > {code} > } catch (SQLException ex) { > // Password has not changed, so refuse client, but return connection to the pool > closeDueToException(info); > throw new SQLException("Given password did not match password used" > + " to create the PooledConnection."); > } > {code} > It would be great if this throw could include the cause exception: > {code} > throw new SQLException("Given password did not match password used" > + " to create the PooledConnection.", ex); > {code} > as we have code that detects login related SQLExceptions and takes actions on them. > -- This message was sent by Atlassian JIRA (v6.2#6252)