You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <ji...@apache.org> on 2009/03/02 16:17:56 UTC

[jira] Commented: (DERBY-4070) Embedded and client data sources throw different exception when a connection attribute is badly formatted

    [ https://issues.apache.org/jira/browse/DERBY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678012#action_12678012 ] 

Rick Hillegas commented on DERBY-4070:
--------------------------------------

Hi Kristian,

The javadoc for ClientBaseDataSource.setConnectionAttributes() says that you should not use this method to set a property which has its own setter method--and if you nevertheless try to do this, the consequences are unpredictable. It's possible that we actually do one of the following and we could just document what we currently do:

1) Throw an exception if setConnectionAttributes() is used to set a property which has its own setter method.

2) Let setConnectionAttributes() always trump the individual setter methods

3) Vice-versa

4) Use whatever the MOST RECENT value of the property is, regardless of whether it was set by setConnectionAttributes() or an individual setter method.

5) Use whatever the FIRST value of the property is, regardless of whether it was set by setConnectionAttributes() or an individual setter method.

If you obtain your Connection from DriverManager, rather than a DataSource, then the situation is governed by the "Attributes of the Derby database connection URL " section of the Reference Guide. As I interpret that section, the URL attributes are added to the passed in Properties and therefore trump the values in the Properties object.

> Embedded and client data sources throw different exception when a connection attribute is badly formatted
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4070
>                 URL: https://issues.apache.org/jira/browse/DERBY-4070
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC, Network Client
>    Affects Versions: 10.4.2.1, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4070-1a-ds_exception_handling.diff, derby-4070-1b-ds_exception_handling.diff
>
>
> If a connection attribute is badly formatted, for instance if the attribute name is specified without a corresponding value, the embedded and the client data sources throw different exceptions:
>   o XJ212: Invalid attribute syntax: bad
>   o XJ028: The URL 'jdbc:derby://localhost:1527/wombat;bad' is not properly formed.
> Currently the only client data source affected is ClientDataSource, but the connection pool and XA data sources also have to deal with this issue when DERBY-4067 has been fixed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.