I have two jobs configured as cronTriggerBeans. They are added to a quartz SchedulerFactoryBean. They run at different times but modify same set of data in a database. Problem occurs on particular occasions when the job running time is the same. In this scenario, I want job2 to wait for job2 to be completed. I realize there is a way to implement this scenario if it's the case every single time. But in my case, one job runs every 1 hour and the other every 24 hours. So when the 24 hours job run, I want to have the hourly job to be finished. How can I achieve it.
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false">
<property name="triggers">
<list>
<ref bean="hourlyJob"/>
<ref bean="twentyFourHourlyJob"/>
</list>
</property>
</bean>
<bean id="hourlyJob" class="org.springframework.scheduling.quartz.CronTriggerBean">
// bean configurations
<bean id="twentyFourHourlyJob" class="org.springframework.scheduling.quartz.CronTriggerBean">
// bean configurations
</bean>