I am using quartz for scheduling purpose. When application is deployed in weblogic cluster environment, the entire server initiates the process. I don’t have DB operation, so that can use select for update query to lock the table and be sure that only one server starts the process. I have file writing operation. Is there any way to configure the quartz to initiates only once?
Code:<bean id="simpleReportTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="dealFeedGeneration" /> </property> <property name="cronExpression"> <value>${scheduleTime}</value> </property> </bean> <bean id="dealFeedGeneration" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <ref bean="feedTaskGenerator" /> </property> <property name="targetMethod"> <value>getDealFeedList</value> </property> </bean> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="simpleReportTrigger" /> </list> </property> </bean>


Reply With Quote