java.sql.SQLFeatureNotSupportedException in LobCreatorBuilderImpl

Description

Application throws exception java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented during hibernation initialization.

This exception not interrupting application work but it very annoying.

As I see hibernate trying to guess is driver support such function or not.

And this driver say that it not supporting this by throwing SQLFeatureNotSupportedException exception. And this is correct answer

I think it will be good to teach hibernate to handle such answer from driver.

In attach Spring Boot Application that illustrate this situation.
Need to change application.properties befor compile and run

spring.datasource.url = jdbcostgresql://localhost:5434/<database>
spring.datasource.username=username
spring.datasource.password=secret

Application ends with NPE. This sample is used as test case for HHH-12332

Environment

Postgresql JDBC Driver 42.1.4

Activity

Show:
Gail Badner
March 7, 2018, 11:33 PM

, IIUC, the exception just gets logged as INFO and Hibernate deals with it properly, doesn't it?

Anton Mityagin
March 8, 2018, 8:41 AM

Yes, it does. But why such exception is logged? I mean what useful information I got when I see SQLFeatureNotSupportedException in my log, while hibernate trying to understand is driver support feature or not

I think that hibernate should handle SQLFeatureNotSupportedException exception, somthing like that:

Gail Badner
March 9, 2018, 12:22 AM

I would say this is very low priority, especially since, as you mentioned, you can set hibernate.jdbc.lob.non_contextual_creation=true

Josef Bajada
March 19, 2018, 12:19 AM

This error is mostly harmless but is creating a lot of confusion to users upgrading to Spring Boot 2.0 which has gone GA, suddenly seeing exceptions in the log which weren't there before.

https://github.com/spring-projects/spring-boot/issues/12007
https://stackoverflow.com/questions/46493500/hibernate-with-c3p0-createclob-is-not-yet-implemented
https://stackoverflow.com/questions/49110818/method-org-postgresql-jdbc-pgconnection-createclob-is-not-yet-implemented

Anton Mityagin
October 3, 2018, 9:53 AM

added PR.

Assignee

Szczepan Kuźniarz

Reporter

Anton Mityagin

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Trivial
Configure