[ 
https://issues.apache.org/jira/browse/IBATIS-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577831#action_12577831
 ] 

Aaron Craven commented on IBATIS-494:
-------------------------------------

I assume you intended a modification to my patch something like this:

    Clob clob = getter.getClob();
    if (clob != null) { ...

would become

    Clob clob = getter.getClob();
    if (!getter.wasNull()) { ...

I made the change and tested it in our development environment, and it works 
fine. I cannot yet test it in our production environment (which is where our 
original problem was), but I am fairly certain it will work there as well.

> 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