final boolean useReader = session.getFactory().getDialect().useInputStreamToInsertBlob() &&
(value instanceof ClobImpl);
if ( useReader ) {
ClobImpl clob = (ClobImpl) value;
st.setCharacterStream( index, clob.getCharacterStream(), (int) clob.length() );
}
else {
st.setClob(index, (Clob) value);
}