简体   繁体   English

org.hibernate.HibernateException:无法访问 lob stream Postgresql 9.6

[英]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:在项目中:

  • Hibernate v. 5.3.10.Final Hibernate v. 5.3.10.Final
  • Spring-jdbc v. 5.1.8.RELEASE Spring-jdbc v. 5.1.8.RELEASE
  • PostgreSQL JDBC Driver - JDBC 4.2 PostgreSQL JDBC 驱动程序 - JDBC 4.2
    42.2.5 42.2.5
  • Postgers DB - 9.6 Postgers DB - 9.6

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:我试过了:

  1. Added @Type(type="text") - main problem was solved, but I got CLOB id instead of real info in CLOB;添加了@Type(type="text") - 主要问题已解决,但我得到的是 CLOB id 而不是 CLOB 中的真实信息;
  2. Added to @Column() columnDefinition = TEXT/CLOB - doesn't work;添加到@Column() columnDefinition = TEXT/CLOB - 不起作用;
  3. Added @Type(type="materialized_clob") or @Type(type="clob") - doesn't work;添加了 @Type(type="materialized_clob") 或 @Type(type="clob") - 不起作用;

  4. 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.

相关问题 org.hibernate.HibernateException:无法访问 lob 流 - org.hibernate.HibernateException: Unable to access lob stream JHipster Spring启动:org.hibernate.HibernateException:无法访问lob流 - JHipster Spring boot : org.hibernate.HibernateException: Unable to access lob stream 如何解决“原因:org.hibernate.HibernateException:无法访问lob流” - How to resolve “Caused by: org.hibernate.HibernateException: Unable to access lob stream” HibernateException:无法访问lob流 - HibernateException: Unable to access lob stream org.hibernate.HibernateException错误 - org.hibernate.HibernateException error org.hibernate.HibernateException:无法实例化默认tuplizer - org.hibernate.HibernateException: Unable to instantiate default tuplizer org.hibernate.HibernateException:无法找到当前的JTA事务 - org.hibernate.HibernateException: Unable to locate current JTA transaction org / hibernate / HibernateException:不支持的major.minor版本52.0(无法加载org.hibernate.HibernateException类) - org/hibernate/HibernateException : Unsupported major.minor version 52.0 (unable to load class org.hibernate.HibernateException) 基本的休眠程序中的org.hibernate.HibernateException - org.hibernate.HibernateException in a basic hibernate program org.hibernate.HibernateException:无法实例化resultclass - org.hibernate.HibernateException: Could not instantiate resultclass
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM