@Override
    com.amazon.carbonado.lob.Clob setClobValue(PreparedStatement ps, int column,
                                               com.amazon.carbonado.lob.Clob clob)
        throws PersistException
    {
        try {
            long length = clob.getLength();
            if (length > CLOB_CHUNK_LIMIT || ((long) ((int) length)) != length) {
                if (mCLOB_empty_lob == null) {
                    return super.setClobValue(ps, column, clob);
                }

                try {
                    ps.setClob(column, (java.sql.Clob) mCLOB_empty_lob.invoke(null));
                    return clob;
                } catch (InvocationTargetException e) {
                    throw mRepo.toPersistException(e.getCause());
                } catch (Exception e) {
                    throw mRepo.toPersistException(e);
                }
            }

            if (clob instanceof OracleClob) {
                ps.setClob(column, ((OracleClob) clob).getInternalClobForPersist());
                return null;
            }

            ps.setCharacterStream(column, clob.openReader(), (int) length);
            return null;
        } catch (SQLException e) {
            throw mRepo.toPersistException(e);
        } catch (FetchException e) {
            throw e.toPersistException();
        }
    }
@ Override com . amazon . carbonado . lob . Clob setClobValue ( PreparedStatement ps , int column , com . amazon . carbonado . lob . Clob clob ) throws PersistException { try { long length = clob . getLength ( ) ; if ( length > CLOB_CHUNK_LIMIT || ( ( long ) ( ( int ) length ) ) != length ) { if ( mCLOB_empty_lob == null ) { return super . setClobValue ( ps , column , clob ) ; } try { ps . setClob ( column , ( java . sql . Clob ) mCLOB_empty_lob . invoke ( null ) ) ; return clob ; } catch ( InvocationTargetException e ) { throw mRepo . toPersistException ( e . getCause ( ) ) ; } catch ( Exception e ) { throw mRepo . toPersistException ( e ) ; } } if ( clob instanceof OracleClob ) { ps . setClob ( column , ( ( OracleClob ) clob ) . getInternalClobForPersist ( ) ) ; return null ; } ps . setCharacterStream ( column , clob . openReader ( ) , ( int ) length ) ; return null ; } catch ( SQLException e ) { throw mRepo . toPersistException ( e ) ; } catch ( FetchException e ) { throw e . toPersistException ( ) ; } }
@return original clob if too large and post-insert update is required, null otherwise