By using CronTriggerBean i have created two triggers(say trigger A & B) for invoking two different action. We have placed our project as .war in 2 servers.I am using JobStoreTX for clustering. The problem i am facing is that i want to cluster only one trigger i.e A and trigger B should not be clustered. Is there a way to specify through code which trigger has to be clustered. My code goes on as below.
<bean id="shedulerJobStoreTX" class="org.quartz.impl.jdbcjobstore.JobStoreTX>
<property name="driverDelegateClass" value="org.quartz.impl. jdbcjobstore.oracle.OracleDelegate">
<property name="dataSource" value ="jndiDS"/>
<property name="tablePrefix" value="someschemaName"/>
<property name="isClustered" value="true"/>
<property name="clusterCheckinInterval" value="${someValue}"/>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronTrigger" />
<ref bean="clusterCronTrigger"/>
</list>
</property>
</bean>
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="runAppJob" />
<property name="cronExpression" value="${someTimeValue1}"/>
</bean>
<bean id="clusterCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="runClusterJob" />
<property name="cronExpression" value="${someTimeValue2}"/>
</bean>
Hi, I have refined the code and the above said issue is not happening.PFB the code for the same.
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronTrigger" />
<ref bean="clusterCronTrigger"/>
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.jobStore.isClustered">false</prop>
<prop key="org.quartz.scheduler.instanceId">AUTO</prop>
<prop key ="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.
JobStoreTX </prop>
<prop key="org.quartz.jobStore.tablePrefix">schemaName</prop>
<prop key="org.quartz.jobStore.driverDelegateClass"> org.quartz.impl.jdbcjobstore.oracle.OracleDelegate</prop>
<prop key="org.quartz.jobStore.selectWithLockSQL"> SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME= ?</prop>
</props>
</property>
<property name="dataSource" ref="fsmJndiDataSource"/>
But the problem on executing the above code is that i am getting the below exception when the quartz is trying to get the lock …”Invocation of init method failed; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-00942: table or view does not exist“
Due to the message “ORA-00942: table or view does not exist”, I think the table “schemaNameLOCKS” is missing. Indeed, from the doc: