DEV Community

Igor Rudel
Igor Rudel

Posted on

3 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

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Sentry image

Make it make sense

Make sense of fixing your code with straight-forward application monitoring.

Start debugging →

👋 Kindness is contagious

Dive into this informative piece, backed by our vibrant DEV Community

Whether you’re a novice or a pro, your perspective enriches our collective insight.

A simple “thank you” can lift someone’s spirits—share your gratitude in the comments!

On DEV, the power of shared knowledge paves a smoother path and tightens our community ties. Found value here? A quick thanks to the author makes a big impact.

Okay