From a899058ac3c386c2423da8bb30daef6193b35fcc Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 12 Oct 2015 18:08:17 +0100 Subject: [PATCH] Add a tip to the docs about using DB_CLOSE_ON_EXIT=false with H2 Closes gh-4135 --- spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 93725b2ec8c..2eb4516763f 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -2081,6 +2081,11 @@ For example, typical POM dependencies would be: ---- +TIP: If you're using H2 and, for whatever reason, you do configure its connection URL, +care should be taken to disable the database's automatic shutdown using +`DB_CLOSE_ON_EXIT=FALSE`. This allows Spring Boot to control when the database is closed, +thereby ensuring that it happens once access to the database is no longer needed. + NOTE: You need a dependency on `spring-jdbc` for an embedded database to be auto-configured. In this example it's pulled in transitively via `spring-boot-starter-data-jpa`.