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

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

我收到以下异常 - org.quartz.impl.jdbcjobstore.LockException:获取数据库行锁失败:ORA-00942:table 或视图不存在 [参见嵌套异常:java.sql.SQLException:ORA- 00942: table 或视图不存在 ].

我已经使用相同的代码工作,但数据库是 Mysql,但我们突然决定将数据库迁移到 ORACLE。

然后我们从 java 一侧上升到 Exception 之上。

根据我的意见,我认为当最初的工作运行时, 它将向数据库 table 输入以下条目:PREFIX_LOCKS

STATE_ACCESS TRIGGER_ACCESS

自动执行,但由于 ORA-00942,此处尝试失败。

现在,我的 Quartz 配置文件看起来像,

#=====================================
# 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 数据库有足够的 tables,石英需要这些 tables 到 oracle 数据库被分发到 Schema wise(可能是这个原因) .

谁能告诉我出了什么问题?

此问题已解决。

问题是, 我试图在 schedule(..) 方法之前调用 Scheduler 的 start() 方法。 . 我只是交换那个顺序,然后同样地做,

1. schedule job
2. start method invoke

以上两种情况都包含在 try..catch...

谢谢。