Java Spring Framework+Quartz Clustering For N-Different Node on Network

心不动则不痛 提交于 2019-12-12 01:42:15

问题


I am getting following excetion - org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-00942: table or view does not exist [See nested exception: java.sql.SQLException: ORA-00942: table or view does not exist ].

I already worked with same code but database was Mysql, But suddenly we have been decided to migrate database to ORACLE.

And we get up above Exception from java side.

As per my opinion, I think when initially job runs, it will enter following entries to the database table : PREFIX_LOCKS

STATE_ACCESS TRIGGER_ACCESS

Automatically, But here it tries but failure because of ORA-00942.

Now, My Quartz Config file looks like,

#=====================================
# Configure Instance
#=====================================

    org.quartz.scheduler.instanceName = MyClusteredScheduler

    org.quartz.scheduler.instanceId = AUTO

#===================================
# Configure ThreadPool
#===================================

    org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool

    org.quartz.threadPool.threadCount = 25

    org.quartz.threadPool.threadPriority = 5


#===================================
# Configure JobStore
#===================================

    org.quartz.jobStore.misfireThreshold = 60000

    org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

    org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate

    org.quartz.jobStore.useProperties = false

    org.quartz.jobStore.tablePrefix = TABLE_PREFIX_NAME

    org.quartz.jobStore.dataSource = customDataSourceName

    org.quartz.jobStore.isClustered = true

    org.quartz.jobStore.clusterCheckinInterval = 20000

#===================================
# Configure Datasources  
#====================================

    org.quartz.dataSource.customDataSourceName.jndiURL =
    java:comp/env/jdbc/SomeName

    org.quartz.dataSource.customDataSourceName.maxConnections = 5

    org.quartz.dataSource.customDataSourceName.validationQuery = 
    select 0 from dual

#================== END OF FILE ==========

NOTE : My Oracle Database has all sufficient tables which are required by quartz & into oracle database is distributed into Schema wise(May be this is cause).

Can anybody tell me whats went wrog ?


回答1:


This Problem resolved.

Problem was, I was trying to invoke start() method of Scheduler before schedule(..) method. . I just swap that order and make that likewise,

1. schedule job
2. start method invoke

above both situation enclosed inside try.. catch...

Thank you.



来源:https://stackoverflow.com/questions/31666351/java-spring-frameworkquartz-clustering-for-n-different-node-on-network

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!