Skip to content

Ensure QuartzDatabaseInitializer is initialized before Scheduler #9411

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

Closed
wants to merge 1 commit into from

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Jun 5, 2017

If auto-configured Scheduler instance backed by JDBC job store is used as a dependency in an application component, the initialization of Scheduler will be triggered before QuartzDatabaseInitializer. This will result in failure due to schema not being prepared in time for Scheduler to populate job details.

I've missed to pay attention to this in #4299 but it is a very common use case with Quartz.

This PR ensures QuartzDatabaseInitializer is initialized before auto-configured Scheduler by introducing a dependency between the two.

I've also updated the tests as well as sample app to include this scenario. @snicoll Please review this and let me know what are your thoughts on the proposed changes.

If auto-configured `Scheduler` instance backed by JDBC job store is used as a dependency in an application component, the initialization of `Scheduler` will be triggered before `QuartzDatabaseInitializer`. This will result in failure due to schema not being prepared in time for `Scheduler` to populate job details.

This commit ensures `QuartzDatabaseInitializer` is initialized before auto-configured `Scheduler` by introducing a dependency between the two.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 5, 2017
@philwebb
Copy link
Member

philwebb commented Jun 6, 2017

Thanks!

@philwebb philwebb added priority: normal type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 6, 2017
@philwebb philwebb added this to the 2.0.0.M2 milestone Jun 6, 2017
@snicoll snicoll self-assigned this Jun 6, 2017
snicoll pushed a commit that referenced this pull request Jun 6, 2017
If the auto-configured `Scheduler` instance backed by JDBC job store is
used as a dependency in an application component, the initialization of
`Scheduler` will be triggered before `QuartzDatabaseInitializer`. This
will result in failure due to schema not being prepared in time for
`Scheduler` to populate job details.

This commit ensures `QuartzDatabaseInitializer` is initialized before the
auto-configured `Scheduler` by introducing a dependency between the two.

See gh-9411
@snicoll snicoll closed this in 7f420d1 Jun 6, 2017
snicoll added a commit that referenced this pull request Jun 6, 2017
* pr/9411:
  Polish contribution
  Ensure `QuartzDatabaseInitializer` is initialized before `Scheduler`
@vpavic vpavic deleted the improve-quartz-support branch June 6, 2017 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants