Strange Oracle bug with Hibernate and CLOB

I ran into the following problem, which seems pretty general . The exception is Cannot update entity: [...] nested exception is java.sql.BatchUpdateException: ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column. It seems that Oracle does not like to bind large values ​​(> 4000 characters) to parameters after LOB or CLOB. Has anyone solved this problem?

+5
source share
2 answers

This is: ORA-24816
** This is a limitation, and that LONG bind variables must be the last in the statement. **

source: http://www.odi.ch/weblog/posting.php?posting=496

: , clob , varchar2 ( clob java 'z'), , clob varchar hibernate .

+9

Hibernate 3.2.1 , CLOB, CLOB.

public class Employee{

    @Lob
    @Column
    private String description;

    //getters setters
}

String desc = emp.getDescription();
emp.setDescription(null);
session.save(entity);
session.flush();
session.evict(entity);

StringBuilder sb = new StringBuilder();
sb.append("update Employee set description:description");
Query updateQuery = session.createQuery(sb.toString());
updateQuery.setParameter("description", desc, Hibernate.STRING);
updateQuery.executeUpdate();

Hibernate, insert. Hibernate v4.1.8.

https://hibernate.atlassian.net/browse/HHH-4635

+2

All Articles