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

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

Dappier Deep Dive: Build, Monetize, Repeat

Join us live with the team at Dappier to explore how to transform your content into AI-powered agents and unlock new revenue streams. We’ll dive into deploying branded AI assistants using Dappier’s AskAI, monetizing through conversational Agentic Ads, and syndicating your data via the Dappier Marketplace. Whether you’re a publisher, developer, or content creator, discover how to future-proof your work and thrive in the AI-driven web.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️