[英]org.hibernate.HibernateException: Unable to access lob stream Postgresql 9.6
Please, help me with this strange thing.请帮我解决这个奇怪的事情。
Yesterday without having any changes in code and DB I got an error when I'd tried to call endpoint: org.hibernate.HibernateException: Unable to access lob stream.昨天没有对代码和数据库进行任何更改,当我尝试调用端点时出现错误:org.hibernate.HibernateException:无法访问 lob stream。
In the project:在项目中:
Entity like this:像这样的实体:
@Lob
@Column(nullable = true)
@Basic(fetch = FetchType.EAGER)
private String payload;
I found in hibernate logs that possible problem may be in ohtdescriptor.sql.BasicExtractor in extracting CLOB.我在 hibernate 日志中发现,提取 CLOB 时可能存在 ohtdescriptor.sql.BasicExtractor 中的问题。 The strangest thing that on dev-stage all works correct, but on dev stage we have postgres 10.1.最奇怪的是,在开发阶段一切正常,但在开发阶段我们有 postgres 10.1。
I've tried:我试过了:
Added @Type(type="materialized_clob") or @Type(type="clob") - doesn't work;添加了 @Type(type="materialized_clob") 或 @Type(type="clob") - 不起作用;
Removed @Transactional from method that uses this entity - doesn't work;从使用此实体的方法中删除 @Transactional - 不起作用;
On dev stage I see in logs:在开发阶段,我在日志中看到:
TRACE o.h.t.descriptor.sql.BasicExtractor - extracted value ([payload4_0_1_] : [CLOB]) - [{"adId":2,"syncStatus":2,"syncErrorCode":0,"syncErrorText":"","crdate":"Sep 25, 2017, 7:16:25 PM","upddate":"Aug 28, 2019, 2:19:00 PM"}]
On another stage I see that if CLOB is null - it works, if not null - I get an error.在另一个阶段,我看到如果 CLOB 是 null - 它可以工作,如果不是 null - 我得到一个错误。
I hope somebody can help me, if info isn't enough I am ready to give additional info.我希望有人可以帮助我,如果信息不够,我准备提供更多信息。
Thanks in advance!提前致谢!
I found possible root cause: Something was happened in DB and CLOBs were deleted and only relation ids stayed in DB.我找到了可能的根本原因:数据库中发生了一些事情,CLOB 被删除,只有关系 ID 留在数据库中。 For previous rows I get in the CLOB field something like 2341535, for current - real json-object.对于前面的行,我在 CLOB 字段中得到类似 2341535 的内容,用于当前 - 真正的 json 对象。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.