jmix icon indicating copy to clipboard operation
jmix copied to clipboard

Use quartz scheduler for scheduled tasks

Open dtaimanov opened this issue 2 years ago • 0 comments

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.

dtaimanov avatar Sep 27 '22 12:09 dtaimanov