Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 45815 invoked from network); 11 Jun 2008 09:49:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2008 09:49:44 -0000 Received: (qmail 88320 invoked by uid 500); 11 Jun 2008 09:49:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 88284 invoked by uid 500); 11 Jun 2008 09:49:46 -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 88273 invoked by uid 99); 11 Jun 2008 09:49:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 02:49:46 -0700 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 09:48:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 31316234C138 for ; Wed, 11 Jun 2008 02:48:45 -0700 (PDT) Message-ID: <1496465132.1213177725200.JavaMail.jira@brutus> Date: Wed, 11 Jun 2008 02:48:45 -0700 (PDT) From: "Kristian Waagan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3581) Changing certain properties on client DataSource objects causes existing connections to reflect the new values In-Reply-To: <1361721084.1206883284338.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristian Waagan updated DERBY-3581: ----------------------------------- Attachment: derby-3581-3a-remove_recomputeFromDataSource_flag.stat derby-3581-3a-remove_recomputeFromDataSource_flag.diff 'derby-3581-3a-remove_recomputeFromDataSource_flag.diff' removes a flag that is always true. It serves no purpose any more, and the associated functionality will not be used/supported by the Derby client driver. Adding it again at a later time, for instance if the community wants to create an enterprise level client side pooling agent, should be pretty easy. The removal also makes the code easier to read and understand. Regression tests ran without failures (Sun JDK 1.6.0, Solaris 10). Patch ready for review. > Changing certain properties on client DataSource objects causes existing connections to reflect the new values > -------------------------------------------------------------------------------------------------------------- > > Key: DERBY-3581 > URL: https://issues.apache.org/jira/browse/DERBY-3581 > Project: Derby > Issue Type: Bug > Components: JDBC, Network Client > Affects Versions: 10.3.2.1, 10.4.1.3, 10.5.0.0 > Reporter: Kristian Waagan > Assignee: Kristian Waagan > Fix For: 10.4.1.4, 10.5.0.0 > > Attachments: derby-3581-1a-remove_user_password_iteration1.diff, derby-3581-2a-remove_datasource_iteration1.diff, derby-3581-3a-remove_recomputeFromDataSource_flag.diff, derby-3581-3a-remove_recomputeFromDataSource_flag.stat > > > The client driver has code propagating changes made to the DataSource to existing connections created by that DataSource. > There is some discussion of this in the thread http://www.nabble.com/ConnectionPoolDataSource-properties-td15740457.html, and there is also an example of what can happen due to this "feature". > Besides from being a bug with the potential to cause strange errors in deployment, the issue also makes the client driver code harder to read and understand. > As far as I can see, there is also some related code in other parts of the client driver, for instance for "fully" resetting statements. There is mention of dynamic versus static sections in the comments (this one from am.Statement): > // If a dataSource is passed into resetClientConnection(), then we will assume > // properties on the dataSource may have changed, and we will need to go through > // the open-statement list on the connection and do a full reset on all statements, > // including preparedStatement's and callableStatement's. This is because property > // change may influence the section we allocate for the preparedStatement, and > // also the cursor attributes, i.e. setCursorSensitivity(). > // If no dataSource is passed into resetClientConnection(), then we will do the > // minimum reset required for preparedStatement's and callableStatement's. > Note that the reset code for statements is also invoked when ClientPooledConnection.getConnection() is invoked. I do not understand why we should reset statements when we get a new logical connection. > Further, I also suspect the concept of a deferred reset has been introduced because of the feature/bug described by this Jira issue. A deferred reset seems to be a mechanism to avoid a round-trip to validate the newly changed DataSource properties (typically user, password and security mechanism). > I will look into removing code related to deferred resets as well. If you have historic information about these parts of the driver, I would appreciate if you share it with the community if possible. > Just to be clear, it is my opinion that changed DataSource properties should take effect when one of the following methods is invoked: > * DataSource.getConnection() > * ConnectionPoolDataSource.getPooledConnection() > * XADataSource.getXAConnection() > All of the methods above returns a physical connection. Properties like user name and password are associated with the physical connection, and thus requests to obtain a logical connection should not cause any of these properties to change. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.