quartz运行中的异常

org.quartz.core.ErrorLogger.schedulerError(QuartzScheduler.java:2358)][org.quartz.core.ErrorLogger]:An error occured while firing trigger'DEFAULT.cronTriggerInterval'

org.quartz.JobPersistenceException:Couldn't update states of blocked triggers: Lock wait timeout exceeded; tryrestarting transaction [See nested exception: java.sql.SQLException: Lock waittimeout exceeded; try restarting transaction]

       at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2950)

       atorg.quartz.impl.jdbcjobstore.JobStoreSupport$38.execute(JobStoreSupport.java:2871)

       atorg.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3788)

       atorg.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2865)

       atorg.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:319)

Caused by: java.sql.SQLException: Lock waittimeout exceeded; try restarting transaction

       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)

       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)

       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)

       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)

       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)

       at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734)

       atcom.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)

       atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)

       atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)

       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)

       atorg.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)

       atorg.quartz.impl.jdbcjobstore.StdJDBCDelegate.updateTriggerStatesForJobFromOtherState(StdJDBCDelegate.java:1695)

        atorg.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2943)

解决:加上org.quartz.jobStore.txIsolationLevelSerializable=true配置,问题原因由于mysql针对innodB引擎默认的事务隔离级别为“repeatableread”,非集群环境下可以使用:txIsolationLevelReadCommitted=true来设置,但集群环境下使用org.quartz.jobStore.txIsolationLevelSerializable代替txIsolationLevelReadCommitted


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值