quartz 調度啟動失敗,with (updlock,rowlock)


原因是driverDelegateClass配置錯誤。

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.MSSQLDelegate
org.quartz.jobStore.dataSource=myDS
org.quartz.jobStore.tablePrefix=qrtz_
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.acquireTriggersWithinLock=true
org.quartz.jobStore.clusterCheckinInterval=30000

將driverDelegateClass改成如下
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate

博主使用的數據庫是Mysql,按理說driverDelegateClass配置成“org.quartz.impl.jdbcjobstore.MSSQLDelegate”應該是沒錯的。
但是使用MSSQLDelegate生成的SQL如下:
SELECT * FROM qrtz_LOCKS WITH (UPDLOCK,ROWLOCK) WHERE SCHED_NAME = 'quartzScheduler' AND LOCK_NAME = 'TRIGGER_ACCESS';

mysql中並不是使用WITH(UPDLOCK,ROWLOCK)作為行鎖方式。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM