我试图将一个长字符串持久化到数据库(异常的堆栈跟踪),我们使用HSQLDB (2.2.9)进行测试,将Postgre用于运行时。
1)我注释的字段如下
@Lob
private String someBigMessage;2)编写了迁移DDL脚本(天桥,但没关系)
..., some_big_message text, ...3)它可以迁移,但是当我执行JUnit测试(它使用hsqldb )时,我得到了以下内容:
org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.GenericJDBCException: could not execute statement; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute statement
...
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute statement
...
Caused by: org.hibernate.exception.GenericJDBCException: could not execute statement
...
Caused by: java.sql.SQLException: java.lang.RuntimeException: unsupported internal operation: Session java.lang.RuntimeException: unsupported internal operation: Session
...
Caused by: org.hsqldb.HsqlException: java.lang.RuntimeException: unsupported internal operation: Session有什么建议吗?谢谢。
发布于 2014-10-22 18:23:46
我迁移到了2.3.1,在同一个地方得到了错误,但有更具体的解释:
HsqlException:数据异常:字符串数据,右截断,然后添加注释@列:
@Lob
@Column(length=20971520)
private String someBigMessage;然后迁移回2.2.9,它就能工作了!
https://stackoverflow.com/questions/25246451
复制相似问题