Error Saving and getting blob from database SQL oracle

前端 未结 2 498
南笙
南笙 2021-01-06 15:13

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          


        
相关标签:
2条回答
  • 2021-01-06 16:14

    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.

    0 讨论(0)
  • 2021-01-06 16:19

    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.

    0 讨论(0)
提交回复
热议问题