在Hibernate中更新表时,我得到了以下异常
ORA-24816:在实际长列或LOB列之后提供的扩展的非长绑定数据
我也提取了sql查询,它看起来像
Update table_name set columnName (LOB)=value, colmun2 (String with 4000)=value where id=?;
实体类
class Test{
@Lob
private String errorText;
@Column(length = 4000)
private String text;
}
请帮帮我,这是怎么回事?
谢谢拉维·库马尔
发布于 2014-05-10 08:47:31
我发现了问题。1.当hibernate更新DB和实体中的数据时,有4000个chars列和lob类型列,然后hibernate抛出此异常。
我已经通过编写两个更新查询1来解决这个问题。首先,我使用Update() 2保存实体。
谢谢拉维
发布于 2014-10-03 15:39:07
运行oerr ora 24816
以获取有关错误结果的详细信息:
$ oerr ora 24816
24816, ... "Expanded non LONG bind data supplied after actual LONG or LOB column"
// *Cause: A Bind value of length potentially > 4000 bytes follows binding for
// LOB or LONG.
// *Action: Re-order the binds so that the LONG bind or LOB binds are all
// at the end of the bind list.
因此,另一个只使用1个查询的解决方案是在所有非LOB/LONG绑定之后移动LOB/LONG绑定。对于Hibernate来说,这可能是可能的,也可能是不可能的。也许更像是:
update T set column2 (String with 4000)=:1, columnName (LOB)=:3 where id=:2;
这种DML限制似乎存在于至少Oracle 8i之后。
参考文献:
发布于 2016-04-01 05:25:43
我在oracle和冬眠的家伙修好了这里中也遇到了同样的错误。
在我的例子中,我们已经使用了hiberante 4.3.7,但是没有提到字段在实体中是Lob
再现步骤
溶液
如果希望看到不同之处,请在进行上述更改后,通过在"true"
中为"hibernate.show_sql"
设置persistence.xml来启用对sql语句的调试。
https://stackoverflow.com/questions/23341391
复制