ClobTypeHandlerCallback handles NULLs incorrectly
-------------------------------------------------

                 Key: IBATIS-494
                 URL: https://issues.apache.org/jira/browse/IBATIS-494
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.3.0
         Environment: WebSphere Application Server 6, DB2/390
            Reporter: Aaron Craven
         Attachments: ClobTypeHandlerCallback.diff

After getting some very strange corruption issues with CLOBs in our production 
environment, I did some digging and I believe ClobTypeHandlerCallback to be 
improperly handling NULLs (though I'm not sure). The attached patch fixed our 
problem. 

Please note that I believe our corruption issues to be aggravated by a poorly 
implemented JDBC driver. I certainly don't think iBatis is corrupting our CLOB 
fields directly. But still, I believe these changes more properly handle values 
in CLOBs.

There are two main modifications:
- in getResult(), the method was defaulting to an empty string if the CLOB was 
null. 
- in setParameter, I replaced setString(null) with setNull(Types.CLOB), which I 
believe to be a more appropriate way to set a column to null in most drivers.

As I said, I'm not a JDBC expert, so I could be wrong on these changes.

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