From 2600e872e3bc477ea1d9b0756abaa0f2f6cadc65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Andres?= Date: Fri, 24 Jan 2025 12:24:29 +0100 Subject: [PATCH 1/2] Warn about limitations of Quartz's schema scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See gh-43955 Signed-off-by: Timothée Andres --- .../src/docs/antora/modules/reference/pages/io/quartz.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc index 1ba8c9d8e2..fbf340bd43 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc @@ -35,6 +35,9 @@ WARNING: By default, the database is detected and initialized by using the stand These scripts drop existing tables, deleting all triggers on every restart. It is also possible to provide a custom script by setting the configprop:spring.quartz.jdbc.schema[] property. +WARNING: SQL Server and Azure SQL databases may not use this mechanism because the script requires the specification of the database name directly. +Make a copy of the script and edit it, before using configprop:spring.quartz.jdbc.schema[] to direct Spring to use it. + To have Quartz use a javadoc:javax.sql.DataSource[] other than the application's main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzDataSource[format=annotation]. Doing so ensures that the Quartz-specific javadoc:javax.sql.DataSource[] is used by both the javadoc:org.springframework.scheduling.quartz.SchedulerFactoryBean[] and for schema initialization. Similarly, to have Quartz use a javadoc:org.springframework.transaction.TransactionManager[] other than the application's main javadoc:org.springframework.transaction.TransactionManager[] declare a javadoc:org.springframework.transaction.TransactionManager[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzTransactionManager[format=annotation]. From 178f693118ca4d7b8b37e8d9223c3d6c4868197f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 24 Jan 2025 11:53:55 +0000 Subject: [PATCH 2/2] Polish "Warn about limitations of Quartz's schema scripts" See gh-43955 --- .../src/docs/antora/modules/reference/pages/io/quartz.adoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc index fbf340bd43..7ff87db760 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc @@ -33,10 +33,9 @@ spring: WARNING: By default, the database is detected and initialized by using the standard scripts provided with the Quartz library. These scripts drop existing tables, deleting all triggers on every restart. -It is also possible to provide a custom script by setting the configprop:spring.quartz.jdbc.schema[] property. - -WARNING: SQL Server and Azure SQL databases may not use this mechanism because the script requires the specification of the database name directly. -Make a copy of the script and edit it, before using configprop:spring.quartz.jdbc.schema[] to direct Spring to use it. +To use a custom script, set the configprop:spring.quartz.jdbc.schema[] property. +Some of the standard scripts – such as those for SQL Server, Azure SQL, and Sybase – cannot be used without modification. +In these cases, make a copy of the script and edit it as directed in the script's comments then set configprop:spring.quartz.jdbc.schema[] to use your customized script. To have Quartz use a javadoc:javax.sql.DataSource[] other than the application's main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzDataSource[format=annotation]. Doing so ensures that the Quartz-specific javadoc:javax.sql.DataSource[] is used by both the javadoc:org.springframework.scheduling.quartz.SchedulerFactoryBean[] and for schema initialization.