java – ORA-24816:在实际LONG或LOB列之后提供的扩展非LONG绑定数据

前端之家收集整理的这篇文章主要介绍了java – ORA-24816:在实际LONG或LOB列之后提供的扩展非LONG绑定数据前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在Hibernate中更新表时遇到异常

ORA-24816:在实际LONG或LOB列之后提供的扩展非LONG绑定数据

我也提取SQL查询,它看起来像

  1. Update table_name set columnName (LOB)=value,colmun2 (String with 4000)=value where id=?;

实体类

  1. class Test{
  2.  
  3. @Lob
  4. private String errorText;
  5.  
  6. @Column(length = 4000)
  7. private String text;
  8. }

请帮帮我,这有什么不妥

谢谢
拉维库马尔

解决方法

运行oerr ora 24816以获取有关错误的详细信息:
  1. $oerr ora 24816
  2. 24816,... "Expanded non LONG bind data supplied after actual LONG or LOB column"
  3. // *Cause: A Bind value of length potentially > 4000 bytes follows binding for
  4. // LOB or LONG.
  5. // *Action: Re-order the binds so that the LONG bind or LOB binds are all
  6. // at the end of the bind list.

因此,仅使用1个查询的另一个解决方案是在所有非LOB / LONG绑定后移动您的LOB / LONG绑定. Hibernate可能会或可能不会这样.也许更像是:

  1. update T set column2 (String with 4000)=:1,columnName (LOB)=:3 where id=:2;

这个DML限制似乎至少来自Oracle 8i.

参考文献:

> http://openacs.org/forums/message-view?message_id=595742
> https://community.oracle.com/thread/417560

猜你在找的Java相关文章