The following scary warning (with stack trace) is logged at application startup when using the embedded Derby driver with Spring Boot 3.1:
2023-05-23T12:03:09.677+02:00 WARN 9796 --- [ restartedMain] com.zaxxer.hikari.pool.ProxyConnection : HikariPool-1 - Connection org.apache.derby.impl.jdbc.EmbedConnection@1991538780 (XID = 340), (SESSIONID = 3), (DATABASE = directory:mxtp), (DRDAID = null) marked as broken because of SQLSTATE(0A000), ErrorCode(20000)
java.sql.SQLFeatureNotSupportedException: Feature not implemented: No details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:106)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:225)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:220)
at org.apache.derby.impl.jdbc.Util.notImplemented(Util.java:289)
at org.apache.derby.impl.jdbc.Util.notImplemented(Util.java:285)
at org.apache.derby.impl.jdbc.EmbedConnection.createNClob(EmbedConnection.java:3728)
at com.zaxxer.hikari.pool.HikariProxyConnection.createNClob(HikariProxyConnection.java)
at org.hibernate.engine.jdbc.env.internal.LobCreationHelper.canCreateNClob(LobCreationHelper.java:104)
.....
````
Reproduced with a minimal project setup via spring initialzr:
- Spring Boot 3.1.0
- Maven
- Java (17)
- Spring Data JPA
- Apache Derby
- And an additional dependency added by hand (see https://github.com/spring-io/start.spring.io/issues/1152 ):
````
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<scope>runtime</scope>
</dependency>
````
**Comment From: wilkinsona**
Thanks for the report but I don't think there's anything we can do about this. You will see the same behavior without Spring Boot if you use Hikari and Derby and call `connection.createNClob()` as Hibernate is doing:
```java
HikariConfig config = new HikariConfig();
config.setDriverClassName("org.apache.derby.jdbc.EmbeddedDriver");
config.setJdbcUrl("jdbc:derby:temp;create=true");
try (HikariDataSource dataSource = new HikariDataSource(config)) {
try (Connection connection = dataSource.getConnection()) {
try {
NClob clob = connection.createNClob();
clob.free();
}
catch (SQLFeatureNotSupportedException ex) {
}
}
}
11:33:40.244 [main] INFO com.zaxxer.hikari.HikariDataSource -- HikariPool-1 - Starting...
11:33:40.388 [main] WARN com.zaxxer.hikari.util.DriverDataSource -- Registered driver with driverClassName=org.apache.derby.jdbc.EmbeddedDriver was not found, trying direct instantiation.
11:33:40.566 [main] INFO com.zaxxer.hikari.pool.PoolBase -- HikariPool-1 - Driver does not support get/set network timeout for connections. (Feature not implemented: No details.)
11:33:40.567 [main] INFO com.zaxxer.hikari.pool.HikariPool -- HikariPool-1 - Added connection org.apache.derby.impl.jdbc.EmbedConnection@1615617512 (XID = 14), (SESSIONID = 1), (DATABASE = temp), (DRDAID = null)
11:33:40.575 [main] INFO com.zaxxer.hikari.HikariDataSource -- HikariPool-1 - Start completed.
11:33:40.582 [main] WARN com.zaxxer.hikari.pool.ProxyConnection -- HikariPool-1 - Connection org.apache.derby.impl.jdbc.EmbedConnection@1615617512 (XID = 14), (SESSIONID = 1), (DATABASE = temp), (DRDAID = null) marked as broken because of SQLSTATE(0A000), ErrorCode(20000)
java.sql.SQLFeatureNotSupportedException: Feature not implemented: No details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:106)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:225)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:220)
at org.apache.derby.impl.jdbc.Util.notImplemented(Util.java:289)
at org.apache.derby.impl.jdbc.Util.notImplemented(Util.java:285)
at org.apache.derby.impl.jdbc.EmbedConnection.createNClob(EmbedConnection.java:3728)
at com.zaxxer.hikari.pool.HikariProxyConnection.createNClob(HikariProxyConnection.java)
at org.springframework.boot.jdbc.DerbyNClobTests.test(DerbyNClobTests.java:41)
The logging is coming from HikariCP. You may want to raise a HikariCP issue proposing different logging behaviour when it catches an SQLFeatureNotSupportedException
Comment From: arvera
I should probably ask on HirakiCP Issue, but I just want to note here that I wonder if there is a way to dissable the creation of CLOB
Comment From: wilkinsona
It's Hibernate that's calling createNClob. HikariCP just passes it through to the underlying JDBC driver (and logs the warning if it fails). Disabling the creation of the CLOB would require changing how Hibernate behaves. In short, it's a Hibernate question I believe.