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 "Andreas Korneliussen (JIRA)" <de...@db.apache.org> on 2006/09/18 16:16:23 UTC

[jira] Commented: (DERBY-1177) updateObject with null as argument causes network driver to fail with NullPointerException

    [ http://issues.apache.org/jira/browse/DERBY-1177?page=comments#action_12435486 ] 
            
Andreas Korneliussen commented on DERBY-1177:
---------------------------------------------

REL NOTE:

Problem 1:
The derby client driver throws an exception when calling ResultSet.updateObject() with a null parameter. This is different from the embedded driver, which would update the column with a SQL NULL value.

Symptoms:
Applications which use ResultSet.updateObject(..) with null values, will get a SQLException from the client driver, however if using the embedded driver, the call will update the column to SQL NULL.

Cause:
Incorrect behaviour in client driver.

Solution:
Fixed client driver to behave as embedded driver. ResultSet.updateObject(..) with a null parameter, will set the column value to SQL NULL.

Workaround:
Instead of using ResultSet.updateObject(..) with null parameter, the client application can use ResultSet.updateNull(..).


Problem 2:
In the client jdbc driver: 
After calling ResultSet.updateNull(..), the method ResultSet.wasNull() and ResultSet.getXXX(..) returns the same values as before updateNull(..) was called. 

Symptoms:
In the client jdbc driver: 
After calling ResultSet.updateNull(..), the method ResultSet.wasNull() and ResultSet.getXXX(..) returns the same values as before updateNull(..) was called. 

Cause:
Incorrect behaviour in client driver.

Solution:
Fixed client driver to behave as embedded driver. After calling  ResultSet.updateNull(..), ResultSet.wasNull() will return true, and ResultSet.getXXX(..) will return values corresponding to what is expected when the column is SQL NULL. 

Workaround:
NA


> updateObject with null as argument causes network driver to fail with NullPointerException
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1177
>                 URL: http://issues.apache.org/jira/browse/DERBY-1177
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.0
>            Reporter: Andreas Korneliussen
>         Assigned To: Andreas Korneliussen
>            Priority: Minor
>             Fix For: 10.2.1.0
>
>         Attachments: DERBY-1177.diff, DERBY-1177.stat, DERBY-1177v2.diff, DERBY-1177v2.stat, DERBY-1177v3.diff, derbyall_report.txt, derbyall_report.txt, UpdateXXXTest.java
>
>
> Calling ResultSet.updateObject(column, object) causes the network driver to give NullPointerException if the object parameter is null.
> Stack trace from test:
> Test output:
> ........E.
> Time: 7.597
> There was 1 error:
> 1) testUpdateObjectWithNull(org.apache.derbyTesting.functionTests.tests.jdbcapi.UpdateXXXTest)java.lang.NullPointerException
>         at org.apache.derby.client.am.CrossConverters.setObject(CrossConverters.java:845)
>         at org.apache.derby.client.am.ResultSet.updateObject(ResultSet.java:3073)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.UpdateXXXTest.testUpdateObjectWithNull(UpdateXXXTest.java:215)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> Will attach the test.
> To run:
> java -Dframework=DerbyNetClient org.apache.derbyTesting.functionTests.harness.RunTest jdbcapi/UpdateXXXTest.junit
> The test does not fail with the embedded framework.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira