DEV Community

Igor Rudel
Igor Rudel

Posted on

3 1 1

Spring Boot 3 + Hibernate: Logando undefined/unknown

A partir de uma certa versão do Spring Boot 3, utilizando JPA o Hibernate adicionou os seguintes log's:

org.hibernate.orm.connections.pooling    : HHH10001005: Database info:
    Database JDBC URL [Connecting through datasource 'HikariDataSource (HikariPool-1)']
    Database driver: undefined/unknown
    Database version: 2.3.232
    Autocommit mode: undefined/unknown
    Isolation level: undefined/unknown
    Minimum pool size: undefined/unknown
    Maximum pool size: undefined/unknown
Enter fullscreen mode Exit fullscreen mode

Para que essas informações venham populadas é necessário definir 2 propriedades:

spring.jpa.hibernate.ddl-auto
spring.jpa.properties.hibernate.connection.url
Enter fullscreen mode Exit fullscreen mode

A spring.jpa.properties.hibernate.connection.url populada:

spring.jpa.properties.hibernate.connection.url=${spring.datasource.url}
Enter fullscreen mode Exit fullscreen mode

O resultado será parecido com este:

org.hibernate.orm.connections.pooling    : HHH10001005: Database info:
    Database JDBC URL [jdbc:h2:mem:db;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA test\;]
    Database driver: org.h2.Driver
    Database version: 2.3.232
    Autocommit mode: false
    Isolation level: undefined/unknown
    Minimum pool size: 1
    Maximum pool size: 20
Enter fullscreen mode Exit fullscreen mode

Outras 3 propriedades que alteram as configurações da conexão/datasource:

spring.jpa.properties.hibernate.connection.autocommit
spring.jpa.properties.hibernate.connection.isolation
spring.jpa.properties.hibernate.connection.pool_size
Enter fullscreen mode Exit fullscreen mode

Na propriedade spring.jpa.properties.hibernate.connection.isolation os possíveis valores são: TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ ou TRANSACTION_SERIALIZABLE

Sentry image

Make it make sense

Only the context you need to fix your broken code with Sentry.

Start debugging →

Top comments (0)

Image of PulumiUP 2025

Transform Your Cloud Infrastructure

Join PulumiUP 2025 on May 6 for Expert Insights & Demos.

Register Now

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay