网络上N个不同节点的Java Spring框架+Quartz集群 [英] Java Spring Framework+Quartz Clustering For N-Different Node on Network
问题描述
我收到以下异常 - org.quartz.impl.jdbcjobstore.LockException:获取数据库行锁失败:ORA-00942:表或视图不存在[参见嵌套异常:java.sql.SQLException:ORA-00942:表或视图不存在].
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 ].
我已经使用相同的代码但数据库是Mysql,但突然我们决定将数据库迁移到ORACLE.
I already worked with same code but database was Mysql, But suddenly we have been decided to migrate database to ORACLE.
然后我们从 java 端爬上 Exception.
And we get up above Exception from java side.
在我看来,我认为当最初的工作运行时,它将在数据库表中输入以下条目:PREFIX_LOCKS
As per my opinion, I think when initially job runs, it will enter following entries to the database table : PREFIX_LOCKS
STATE_ACCESSTRIGGER_ACCESS
STATE_ACCESS TRIGGER_ACCESS
自动,但在这里它尝试但由于 ORA-00942 失败.
Automatically, But here it tries but failure because of ORA-00942.
现在,我的 Quartz 配置文件看起来像,
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 ==========
注意:我的 Oracle 数据库拥有 Quartz & 所需的所有足够的表.进入oracle数据库被明智地分配到Schema中(可能是这个原因).
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 ?
推荐答案
此问题已解决.
问题是,我试图在 schedule(..) 方法之前调用 Scheduler 的 start() 方法..我只是交换那个顺序然后做同样的,
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
以上两种情况都包含在 try.. catch... 中.
above both situation enclosed inside try.. catch...
谢谢.
这篇关于网络上N个不同节点的Java Spring框架+Quartz集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!