New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring boot 2.6.0 Quartz mysql/mariadb tables are not created #29095
Comments
@chrisdev0 thank you so much for the detailed report and sample. Can you share why you've overridden the integration initializer? |
Sorry, I forgot to remove that bean when copy pasting from my other project. I've removed that bean in the example now. |
This commit improves the database initializer to support comment prefixes. The Quartz initializer uses this feature and that setting was ignored prior to this commit. Closes spring-projectsgh-29095
I've pushed a fix on my fork but it breaks a protected method and I can see ourselves breaking this some more as new settings are added. The previous implementation had a way to customize the I am not sure what to do at this point so I've flagged it so that someone else on the team can have a look. |
In spring boot 2.6.1 the creation of the Quartz tables for (at least) mysql and mariadb have stopped working.
The cause is that the spring.quartz.jdbc.comment-prefix property isn't used on the way to the runScripts method in DataSourceScriptDatabaseInitializer so the ResourceDatabasePopulator is never configured with these comment-prefixes.
This causes the default comment-prefixes to be used (which is --) and since the org.quartz-scheduler:quartz:2.3.2 dependency mysql/mariadb sql files (in org.quartz.impl.jdbcjobstore) have non -- prefixed comments the results is broken sql.
The exception is then silently ignored (unless debug log level) due to continueOnError being true.
A temporary solution is to extract the .sql-file in the org.quartz-scheduler:quartz dependency, remove the # comments on top and then overriding the schema used to initialize the quartz tables by using the property spring.quartz.jdbc.schema
I've created a small example of the bug here https://github.com/chrisdev0/quartz-bug
run with default profile results in error on startup due to
Caused by: java.sql.SQLException: Table 'quartz_bug.qrtz_locks' doesn't exist
run with workaround profile and it will start since it's using the extracted schema sql file with the comments removed
The text was updated successfully, but these errors were encountered: