In the ClobTypeDescriptor class, the hibernate.jdbc.use_streams_for_binary param is used to choose a binding strategy, using either the PreparedStatement.setClob(..), or the PreparedStatement.setCharacterStream(..) method.
Nevertheless, the extractor part seems to always rely on ResultSet.getClob(String), ignoring the hibernate.jdbc.use_streams_for_binary param:
public <X> ValueExtractor<X> getExtractor(final JavaTypeDescriptor<X> javaTypeDescriptor) {
returnnew BasicExtractor<X>( javaTypeDescriptor, this ) {
@Override
protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException {
return javaTypeDescriptor.wrap( rs.getClob( name ), options );
}
};
}
Couldn't this method depend on hibernate.jdbc.use_streams_for_binary too, in order to use ResultSet.getCharacterStream(String) when preferring streams?
If I'm not mistaken, it seems quite simple to implement too: just make the getExtractor method symmetrical to the getClobBinder one; thus providing concrete implementations in the provided CLOB_BINDING (with getClob()) and STREAM_BINDING (with getCharacterStream()) TypeDescriptors only.
I could provide a pull request if needed.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
In the ClobTypeDescriptor class, the hibernate.jdbc.use_streams_for_binary param is used to choose a binding strategy, using either the PreparedStatement.setClob(..), or the PreparedStatement.setCharacterStream(..) method.
Nevertheless, the extractor part seems to always rely on ResultSet.getClob(String), ignoring the hibernate.jdbc.use_streams_for_binary param:
Couldn't this method depend on hibernate.jdbc.use_streams_for_binary too, in order to use ResultSet.getCharacterStream(String) when preferring streams?
If I'm not mistaken, it seems quite simple to implement too: just make the getExtractor method symmetrical to the getClobBinder one; thus providing concrete implementations in the provided CLOB_BINDING (with getClob()) and STREAM_BINDING (with getCharacterStream()) TypeDescriptors only.
I could provide a pull request if needed.