Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 2055 invoked from network); 13 Feb 2006 23:09:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Feb 2006 23:09:08 -0000 Received: (qmail 35819 invoked by uid 500); 13 Feb 2006 23:09:07 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 35789 invoked by uid 500); 13 Feb 2006 23:09:07 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 35780 invoked by uid 99); 13 Feb 2006 23:09:07 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2006 15:09:04 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 15482DE for ; Tue, 14 Feb 2006 00:08:44 +0100 (CET) Message-ID: <1359037725.1139872124085.JavaMail.jira@ajax.apache.org> Date: Tue, 14 Feb 2006 00:08:44 +0100 (CET) From: "Michael Hackett (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-974) ClientDriver can lose some connection properties In-Reply-To: <1720554496.1139870383935.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-974?page=comments#action_12366259 ] Michael Hackett commented on DERBY-974: --------------------------------------- I should also mention that it was Spring's DriverManagerDataSource class that exposed this issue, and I originally thought the problem was there. It makes a new Properties object from the original one using the Properties(Properties defaults) constructor, instead of clone(). I'm not sure whether one is preferred over another, but using the method I describe gives the correct results in any situation, and I believe it to be the more correct way to work with Properties objects. > ClientDriver can lose some connection properties > ------------------------------------------------ > > Key: DERBY-974 > URL: http://issues.apache.org/jira/browse/DERBY-974 > Project: Derby > Type: Bug > Components: Network Client > Versions: 10.1.2.1, 10.1.2.2 > Environment: Linux, Sun JRE 1.5 > Reporter: Michael Hackett > Priority: Minor > Attachments: ClientDriver.java-diff, PropertiesTest.java > > Internally, the ClientDriver class's appendDatabaseAttributes() method uses keys() on the connection properties to get a list of the property names. However, this misses any properties in the default set. The correct method for a Properties object is propertyNames(). This will return the same type of object as keys(), but will include all properties. > (It is unfortunate that Sun chose to make Properties a subclass of Hashtable, instead of giving Properties a Hashtable, as the former exposes too much implementation.) > The fix is to simply replace calls to keys() on all Property objects to use propertyNames(). A quick search revealed that this is not the only place in the code base where this is done, so a more thorough scan should be made. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira