I\'m trying to save a CLOB into the database and recovering it, but I\'m getting an SQLException:
Caused by: java.sql.SQLException: Lob read/write functions
Setting the hibernate property
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
sorved the problem for me.
Setting the lobCreator for SessionFactory to NonContextualLobCreator is probably a better solution (not tried yet).
However I'm not sure what causes this error.
I encountered a similar problem in one of the projects, setting
updatable = false
fixed the issue for me.
Example:
@Lob
@Column(name = "CONTENT", updatable = false)
Blob content;
Hibernate somehow tries to re-save the content, even when it was not changed.