ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Dealing with large CLOBs and Oracle 10g
Date Wed, 03 Sep 2008 17:58:54 GMT
iBATIS' Clob type handler is trying to convert the entire Clob to a String -
I guess this is where the issue lies.  If this can't be fixed through the
setting of some driver property, then I think you'll have to write and
register a new type handler, then carry around the Clob instead of the
String in your result objects.  With the Clob you can get bits and pieces
out without overwhelming the Oracle implementation.

Jeff Butler



On Wed, Sep 3, 2008 at 12:24 PM, Paul Sanders <tendancer@gmail.com> wrote:

>
> We recently upgraded our databases from 9i to 10g and now we are running
> into
> a problem when fetching rows containing large CLOBs. Here's a snippet of
> our
> resultMap:
>
>  <resultMap class="Audit" id="fetch-audit-events-map">
>       <result property="oldData" columnIndex="12" jdbcType="CLOB"/>
>       <result property="newData" columnIndex="13" jdbcType="CLOB" />
> </resultMap>
>
> OLDDATA and NEWDATA are both defined as CLOB in the table.
>
> Queries that used to work before now fail with an Oracle error:
>
> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation;
> uncategorized SQLException for SQL []; SQL state [99999]; error code
> [22835]; --- The error occurred in
> com/sony/playstation/scert/mediuscentral/persistence/maps/AuditMap.xml. ---
> The error occurred while applying a parameter map. --- Check the
> search-audit-events. --- Check the output parameters (retrieval of output
> parameters failed). --- Cause: java.sql.SQLException: ORA-22835: Buffer too
> small for CLOB to CHAR or BLOB to RAW conversion (actual: 5548, maximum:
> 4000) ; nested exception is
> com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred
> in com/sony/playstation/scert/mediuscentral/persistence/maps/AuditMap.xml.
> --- The error occurred while applying a parameter map. --- Check the
> search-audit-events. --- Check the output parameters (retrieval of output
> parameters failed). --- Cause: java.sql.SQLException: ORA-22835: Buffer too
> small for CLOB to CHAR or BLOB to RAW conversion (actual: 5548, maximum:
> 4000)
>
> Some research reveals that in 9i a CLOB was truncated to 4000 chars when
> converted to a string, but in 10g it now throws an Oracle exception. Since
> it is iBatis that is doing the conversion I don't know how to start going
> about fixing this - anyone got any ideas?
>
> Thanks
>
> Paul
>
> --
> View this message in context:
> http://www.nabble.com/Dealing-with-large-CLOBs-and-Oracle-10g-tp19293940p19293940.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message