据我所知,我必须手动更改DB中的CRON_TRIGGERS表。脏...
有什么方法可以更像这样吗?:
或者什么是典型的解决方案?
答案 0 :(得分:1)
<property name="overwriteExistingJobs" value="true"/>
中正确设置SchedulerFactoryBean
,则应自动更新作业时间表。答案 1 :(得分:0)
试试这样:
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="yourJobDetail" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="yourJobTrigger" />
</list>
</property>
<property name="configLocation" value="file:${HOME}/yourProperties.properties" />
<!-- Commented, because don't work with autocommit = false on spring data source -->
<!-- <property name="dataSource" ref="mainDataSource"/> -->
<property name="transactionManager" ref="mainTransactionManager" />
<property name="autoStartup" value="true" />
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<property name="jobFactory">
<bean class="FactoryForJobWithInjectionOfSpringBbean" />
</property>
<!-- Will update database cron triggers to what is in this jobs file on each deploy. Replaces all previous trigger and job data that
was in the database. YMMV -->
<!-- dont work properly with cluster -->
<!-- <property name="overwriteExistingJobs" value="true" /> -->
</bean>
不幸的是我认为:
<property name="overwriteExistingJobs" value="true" />
在群集模式下无法正常工作。