From 53622076c161ad5838211cf81d0df73d83a61a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 20 May 2024 14:23:01 +0200 Subject: [PATCH] Update data-jdbc README Add lifecycle documentation. --- data/data-jdbc/README.adoc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/data/data-jdbc/README.adoc b/data/data-jdbc/README.adoc index 60b192c..2687d44 100644 --- a/data/data-jdbc/README.adoc +++ b/data/data-jdbc/README.adoc @@ -1 +1,22 @@ Tests if Spring Data JDBC with HikariCP is working. + +== Lifecycle configuration guidance + +Non-embedded databases require extra configuration to avoid Hibernate to contact the remote database before the refresh phase: + +``` +# Specify explicitly the dialect (here for PostgreSQL, adapt for your database) +# Supported as of Spring Boot 3.3 +spring.data.jdbc.dialect=postgresql + +# Database initialization should typically be performed outside of Spring lifecycle +spring.sql.init.mode=never +``` + +=== CRaC + +In order to allow checkpoint/restore to work as expected, Hikari pool suspension should be enabled: + +``` +spring.datasource.hikari.allow-pool-suspension=true +```