hibernate with c3p0: createClob() is not yet implemented

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 14:40:48

Set hibernate.jdbc.lob.non_contextual_creation=true on your persistence.xml

Just in case someone finds this thread in search for the postgresql equivalent bug:

java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.

application.properties:

# disable driver's feature detection
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false

# without detection you have to set the dialect by hand
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

BTW: Spring Boot 2.0.0.RELEASE uses a broken postgresql driver version, I had to specify 42.2.0 so that the driver gets loaded at all:

Caused by: java.lang.RuntimeException: Failed to load driver class org.postgresql.Driver in either of HikariConfig class loader or Thread context classloader

UPDATE 2018-03-01:

According to this issue, the Stacktrace is considered a warning and can be ignored

https://github.com/spring-projects/spring-boot/issues/12007#issuecomment-369388646

UPDATE 2018-03-13:

There's now an official bug report: https://hibernate.atlassian.net/browse/HHH-12368

In Spring Boot, setting this property on the application.properties fix the issue:

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!