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

Knut Anders Hatlen commented on DERBY-3853:
-------------------------------------------

Thanks for the patch. With that solution some of the calls to setTypeMap() that 
used to succeed on the embedded driver will start throwing exceptions. This may 
break existing applications, so I think it's probably safer to make the changes 
on the client driver instead.

Some minor comments about the test changes:

- I don't think the calls to sqle.getNextException() are necessary when 
invoking assertSQLState(), since assertSQLState() is supposed to follow the 
exception chain until it finds a match

- Code like the example below should have a call to fail() at the end of the 
try block in order to detect if the code didn't throw any exception:

+        try {
+            cs.execute();
+        } catch (SQLException sqle) {
+            assertSQLState("0A000", sqle.getNextException());
+        }

> Behaviour of setTypeMap() differs between embedded and client
> -------------------------------------------------------------
>
>                 Key: DERBY-3853
>                 URL: https://issues.apache.org/jira/browse/DERBY-3853
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC, Newcomer
>    Affects Versions: 10.5.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Yun Lee
>            Priority: Minor
>         Attachments: DERBY-3853-1.patch, DERBY-3853-1.stat
>
>
> On the embedded driver, Connection.setTypeMap() behaves like this (when the 
> connection is not closed):
>   - if the map argument is null, throw an SQLException with SQLState XJ081
>   - if the map is not null and not empty, throw an SQLException with SQLState 
> 0A000
>   - if the map is not null and empty, do nothing
> The behaviour on the client driver is this:
>   - always throw an SQLException with SQLState 0A000
> We should try to make the two drivers behave the same way when setTypeMap() 
> is called. (This would also allow us to simplify some of the tests in 
> J2EEDataSourceTest).

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