From 551e98760511d1af5637a1904b648fae795f8b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 24 Jan 2024 10:36:32 +0100 Subject: [PATCH] Provide Spring Data JPA CRaC configuration guidance Closes gh-54 --- data/data-jpa/README.adoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/data/data-jpa/README.adoc b/data/data-jpa/README.adoc index 7a1eec1..c122635 100644 --- a/data/data-jpa/README.adoc +++ b/data/data-jpa/README.adoc @@ -1 +1,21 @@ Tests if Spring Data JPA with Hibernate, MySQL & HikariCP is working. + +=== CRaC configuration guidance + +In order to allow checkpoint/restore to work as expected, Hikari pool suspension should be enabled: + +``` +spring.datasource.hikari.allow-pool-suspension=true +``` + +Non-embedded databases require extra configuration to avoid Hibernate to contact the remote database when creating the checkpoint: +``` +# 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 + +# Database initialization will typically be performed outside of Spring lifecycle +spring.sql.init.mode=never +```