db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4070) Embedded and client data sources throw different exception when a connection attribute is badly formatted
Date Mon, 02 Mar 2009 15:17:56 GMT

    [ 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.


Mime
View raw message