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

Kristian Waagan commented on DERBY-4070:
----------------------------------------

Hi, Dag.

I don't think I have answered Rick's question.

A quick look at the ClientDataSource indicates that Rick's option (2) is what 
we're doing currently. The attribute string is parsed when getConnection() is 
invoked. DERBY-4067 tracks the bug where two of the data source implementations 
fail to parse the attribute string - effectively ignoring them. There was also 
a problem with SSL, see DERBY-4073.

My work on DERBY-4073 makes me wonder if option (1) may get us into trouble. 
Although it may be the most correct solution, I fear that it may cause issues 
when Derby is used with for instance application servers.
Maybe the variation (1a) below can be used instead?

 1a) If a property with its own setter method is set using both the setter and 
in setConnectionAttributes(), throw an exception.

The goal of (1a) is to notify users that a property is set in two different 
ways. It may come as a surprise that one of the values is overridden.

Since the embedded data source implementations seem to differ from the client 
ones (wrt connection attributes), I think I'll write a test to determine the 
behavior.

> 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.6.1.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4070-1a-ds_exception_handling.diff, 
> derby-4070-1b-ds_exception_handling.diff, 
> derby-4070-1c-ds_exception_handling.diff, 
> derby-4070-1d-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.

Reply via email to