jmix
jmix copied to clipboard
Use quartz scheduler for scheduled tasks
Problem
com.haulmont.cuba.core.app.scheduling.Scheduling#processScheduledTasks()
uses org.springframework.scheduling.annotation.Scheduled
annotation which sometimes triggers task execution and database calls before other beans initialized. E.g. before io.jmix.eclipselink.impl.support.JmixEclipseLinkJpaVendorAdapter.JmixEclipseLinkSessionCustomizer
set which makes entities not cacheable.
Solution
Use quartz scheduler or another way to delay first task execution till application context fully initialized.
Temporary workaround:
Add initial delay.