Hi, I am not sure which section to post this so I apologize in advance. I am relatively new to Spring and even newer to Quartz. I have been learning the technology but have run into a wall with Quartz.
Basically I am using a Quartz scheduler that persists all the jobs/triggers/etc on a database. Everything is find and dandy. Runs as expected. However if I need to change the schedule of a Trigger (lets says from eveny 2 seconds to every 5 second). The issue is that changing the repeatInterval value in the bean does not change in the database. So the Trigger still fires every 2 seconds. The only way I was able to change it was by directly deleting the Tigger from the database - which to me is obviously not the best or only way to do it?
Does any one have any insight on what I am missing? Below are my beans. HelloJob such prints "Hello" to console plus the current time.
Thanks in advance!
Code:<bean name="helloJob" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="com.myorg.Spring.Quartz.HelloJob"/> </bean> <bean id="helloTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <property name="jobDetail" ref="helloJob"/> <property name="repeatInterval" value="2000"/> </bean> <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="jdbc:sqlserver://HOST;instanceName=INST1;responseBuffering=adaptive"/> <property name="username" value="USER"/> <property name="defaultCatalog" value="DB"/> <property name="password" value="PASSWORD"/> <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> </bean> <bean id="myScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="helloTrigger"/> </list> </property> <property name="dataSource"> <ref bean="myDataSource"/> </property> <property name="quartzProperties"> <props> <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop> <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.MSSQLDelegate</prop> <prop key="org.quartz.jobStore.misfireThreshold">60000</prop> <prop key="org.quartz.jobStore.dontSetAutoCommitFalse">false</prop> <prop key="org.quartz.jobStore.selectWithLockSQL">SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?</prop> </props> </property> </bean>


Reply With Quote
