From 85006d90b8c0f8a50f39ba85b92fa1ca0fd17f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 20 May 2024 14:18:58 +0200 Subject: [PATCH] Update data-jpa README Refine the documentation and provide up to date configuration for Spring Boot 3.3 / Hibernate 6.5. --- data/data-jpa/README.adoc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/data/data-jpa/README.adoc b/data/data-jpa/README.adoc index cc3de10..b118bce 100644 --- a/data/data-jpa/README.adoc +++ b/data/data-jpa/README.adoc @@ -2,19 +2,22 @@ Tests if Spring Data JPA with Hibernate, MySQL & HikariCP is working. == Lifecycle configuration guidance -Non-embedded databases require extra configuration to avoid Hibernate to contact the remote database before the Lifecycle refresh phase: +Non-embedded databases require extra configuration to avoid Hibernate to contact the remote database before the refresh phase: ``` -# Specify explicitly the dialect (here for MySQL, adapt for your database) -spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect +# Specify explicitly the dialect (here for PostgreSQL, adapt for your database) +spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect # Disable Hibernate usage of JDBC metadata -spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false +# Use spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false for Hibernate 6.4 and ealier +spring.jpa.properties.hibernate.boot.allow_jdbc_metadata_access=false -# Database initialization will typically be performed outside of Spring lifecycle +# Database initialization should typically be performed outside of Spring lifecycle spring.jpa.hibernate.ddl-auto=none spring.sql.init.mode=never ``` +NOTE: The supported dialects can be found https://docs.jboss.org/hibernate/orm/6.5/userguide/html_single/Hibernate_User_Guide.html#compatibility-database[here]. + === CRaC In order to allow checkpoint/restore to work as expected, Hikari pool suspension should be enabled: