Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 54367 invoked from network); 29 Jun 2010 17:38:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Jun 2010 17:38:45 -0000 Received: (qmail 14869 invoked by uid 500); 29 Jun 2010 17:38:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 14156 invoked by uid 500); 29 Jun 2010 17:38:44 -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 13768 invoked by uid 99); 29 Jun 2010 17:38:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jun 2010 17:38:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jun 2010 17:38:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5THUn5M003598 for ; Tue, 29 Jun 2010 17:30:50 GMT Message-ID: <5090343.118241277832649835.JavaMail.jira@thor> Date: Tue, 29 Jun 2010 13:30:49 -0400 (EDT) From: "Kristian Waagan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4719) Define consistent Derby data source behavior In-Reply-To: <15654910.90201277730469835.JavaMail.jira@thor> 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/DERBY-4719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883620#action_12883620 ] Kristian Waagan commented on DERBY-4719: ---------------------------------------- Hi again Rick, i') I think that's the pattern being followed, but note that there may be explicit setters for attributes that cannot be controlled by the connection attribute string (for instance setMaxStatements to control the client side JDBC statement caching). This may very well be an oversight, and yet another thing we can settle when we know how we want things. ii') Yes, hopefully by refactoring and reusing code in the driver (I haven't looked into this). iii') I haven't yet convinced myself which mechanism should have precedence (setter or attribute string), i.e. what the users want and why. The situation for the GUIs I was thinking about will be the same as for the XML case, so letting one trump the other regardless of order is fine. In the GUI you can see the list of "bean properties", for instance "traceLevel" (which will be mapped to "setTraceLevel") and "connectionAttributes" (mapped to "setConnectionAttributes"). Regarding DERBY-4067, it will only make ClientConnectionPoolDataSource and ClientXADataSource parse the connection attribute string. Then all three client data sources will behave identical. Wrt precedence, whatever is in the connection attribute string when the connection is initiated (getConnection, getPooledConnection or getXAConnection) will take effect. I'd prefer creating a new Jira for changing that, since some tests have been disabled due to DERBY-4067 (there is also a duplicate issue logged for traceFile specifically) and it would be nice to get it fixed soon. That fix can also be backported I guess, but we should probably not change the precedence rules for already released versions. > Define consistent Derby data source behavior > -------------------------------------------- > > Key: DERBY-4719 > URL: https://issues.apache.org/jira/browse/DERBY-4719 > Project: Derby > Issue Type: Task > Components: Documentation, Javadoc, JDBC, Network Client > Affects Versions: 10.7.0.0 > Reporter: Kristian Waagan > > The behavior of the various data source implementations in Derby isn't consistent. > As a starting point, from the thread [1] on derby-dev: > ----- > Hi, > I have been investigating how the various Derby data source implementations behave when it comes to [bean] properties. > Properties and attributes are used interchangeably, and I'll be using the following abbreviations: > o DS-[E|C] the "normal" data souce embedded/client > o CP-[E|C] ConnectionPoolDataSource embedded/client > o XA-[E|C] XADataSource embedded/client > Here are some of the current issues: > 1) CP-C and XA-C effectively ignore the connection attribute string for certain attributes (those who have individual setters, DERBY-4067) > 2) *-E don't update the internal property state based on the connection attribute string (i.e. specifying ";user=myuser" won't change the return value of getUser() after connect). > 3) Only some of the properties are updated from the connection attribute string. This is as expected, but it is confusing that for instance 'traceDirectory' is updated and 'traceLevel' isn't. > 4) *-C has 'APP' as the default user, *-E has . > 5) Some property setters accept all values, others throw an exception if the value is invalid. > I don't think all these issues should be fixed, but I'd like to fix (1), as it has caused some trouble in the past (i.e., user not understanding why the settings aren't taking effect). > There are several possible fixes for (1): > 1a) Make CP-C and XA-C process the connection attribute string to update the internal state. > 1b) Make DS-C ignore the connection attribute string (may break existing deployments). > 1c) Throw exception if a property with a setter is specified in the connection attribute string. > I don't care that much about which solution is chosen, but I'd prefer that the various data sources are consistent. For instance, it would be nice if a user could swap ClientDataSource with ClientConnectionPoolDataSource without having to change the data source definition. For instance, doing this today with "ssl=basic" in the connection attribute string would make DS-C connect with SSL, but CP-C would connection without SSL. > We have this wording in the JavaDoc for ClienBaseDataSource.setConnectionAttributes(String): > "Set this property to pass in more Derby specific connection URL attributes. > Any attributes that can be set using a property of this DataSource implementation (e.g user, password) should not be set in connectionAttributes. Conflicting settings in connectionAttributes and properties of the DataSource will lead to unexpected behaviour." > Any opinions or questions on any of this? > Regards, > ----- > [1] http://old.nabble.com/Derby-data-sources-to28692616.html#a28692616 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.