添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction java定时任务

最新推荐文章于 2023-02-22 15:25:41 发布
最新推荐文章于 2023-02-22 15:25:41 发布

java定时任务报错: ,localhost-startStop-1,quartz.LocalDataSourceJobStore:3876,ERROR,ClusterManager: Error managing cluster: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction [See nested exception: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction]

 Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
  Using job-store 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' - which supports persistence. and is clustered.
2020-03-04 17:20:00,419,localhost-startStop-1,impl.StdSchedulerFactory:1327,INFO,Quartz scheduler 'permissionEngineScheduler-dev-v_lsslli' initialized from an externally provided properties instance.
2020-03-04 17:20:00,419,localhost-startStop-1,impl.StdSchedulerFactory:1331,INFO,Quartz scheduler version: 2.2.2
2020-03-04 17:20:00,421,localhost-startStop-1,core.QuartzScheduler:2311,INFO,JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@416275ca
2020-03-04 17:20:00,891,localhost-startStop-1,support.DefaultLifecycleProcessor:345,INFO,Starting beans in phase 2147483647
2020-03-04 17:20:00,892,localhost-startStop-1,quartz.SchedulerFactoryBean:671,INFO,Starting Quartz Scheduler now
2020-03-04 17:27:23,023,localhost-startStop-1,quartz.LocalDataSourceJobStore:3876,ERROR,ClusterManager: Error managing cluster: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction
org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction [See nested exception: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction]
	at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:157)
	at org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:113)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3278)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3870)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.initialize(JobStoreSupport.java:3855)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:687)
	at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:567)
	at org.quartz.impl.StdScheduler.start(StdScheduler.java:142)
	at org.springframework.scheduling.quartz.SchedulerFactoryBean.startScheduler(SchedulerFactoryBean.java:672)
	at org.springframework.scheduling.quartz.SchedulerFactoryBean.start(SchedulerFactoryBean.java:742)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:50)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:350)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:880)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at com.tenpay.fsmart.mvc.listener.SystemContextLoaderListener.contextInitialized(SystemContextLoaderListener.java:47)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2313)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2714)
	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2711)
	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:145)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227)
	at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:96)
	... 30 more
2020-03-04 17:27:23,025,localhost-startStop-1,core.QuartzScheduler:575,INFO,Scheduler permissionEngineScheduler-dev-v_lsslli_$_v_lsslli-PC21583313600379 started.
2020-03-04 17:27:23,030,localhost-startStop-1,context.ContextLoader:344,INFO,Root WebApplicationContext: initialization completed in 450453 ms
2020-03-04 17:27:23,040,localhost-startStop-1,extension.ExtensionLoader:59,INFO,Extension new instance:interface com.tenpay.fsmart.mvc.matcher.IPathMatcher=com.tenpay.fsmart.mvc.matcher.impl.DefaultPathMatherImpl@7c61ead0
2020-03-04 17:27:23,055,localhost-startStop-1,extension.ExtensionLoader:59,INFO,Extension new instance:interface com.tenpay.fsmart.mvc.matcher.IPathMatcher=com.tenpay.fsmart.mvc.matcher.impl.DefaultPathMatherImpl@1ee7a13e
2020-03-04 17:27:23,059,localhost-startStop-1,extension.ExtensionLoader:59,INFO,Extension new instance:interface com.tenpay.fsmart.mvc.matcher.IPathMatcher=com.tencent.fit.permission.permission.PermissionPathMatherImpl@6ce97a1b
2020-03-04 17:27:23,064,localhost-startStop-1,extension.ExtensionLoader:59,INFO,Extension new instance:interface com.tenpay.fsmart.mvc.filter.support.IPermissionDenyService=com.tenpay.fsmart.mvc.filter.support.impl.DefaultPermissionDenyServiceImpl@1674b2b4
三月 04, 2020 5:27:23 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'dispatch-servlet'

解决
在定时任务的文件配置中添加

org.quartz.jobStore.lockHandler.class=org.quartz.impl.jdbcjobstore.StdRowLockSemaphore
org.quartz.jobStore.lockHandler.maxRetry=7
org.quartz.jobStore.lockHandler.retryPeriod=3000

参考:https://github.com/quartz-scheduler/quartz/issues/268

Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transaction java定时任务 java定时任务报错: ,localhost-startStop-1,quartz.LocalDataSourceJobStore:3876,ERROR,ClusterManager: Error managing cluster: Failure obtaining db row lock: Lock wait timeout exceeded; try restarting transacti...
执行数据删除操作时一直超时并弹出Lock wait timeout exceeded; try restarting transaction错误 1.先查看数据库的事务隔离级别 select @@tx_isoloation; REPEATABLE-READ // MySQL默认的事务隔离级别就是REPEATABLE-READ 2.查询数据库线程情况,看是否有...
Weather是一个用Java编写的简单GUI应用程序,它显示当前天气和所输入城市的7天预报。 应用程序使用OpenWeatherMap服务获取所需的数据。 在OpenWeatherMap上注册以获取您的api密钥。 将Constants.java文件中的apiKey属性设置为您的api密钥。 注意:您必须在OpenWeatherMap中具有中型帐户计划才能获取16天的天气预报数据。 如果您是学生或老师,则可以通过电子邮件与他们联系以获得中型计划。 天气符合MIT许可的条款和条件。 MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this softw The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including witho
== 项目的mysql数据库版本由5.1.x更换为5.7.x后出现了一些问题,现将其中的一些问题记录一下 == 其中大部分问题都需要修改数据库的配置文件进行解决,所以先将如何找到mysql配置文件记录下来,如下 1. 执行 which mysql 命令,通过此命令找到mysql的安装位置 比如:/usr/bin/mysql 2. 执行 /usr/bin/mysql -...
MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modi
URL嗅探器 URLSniffer是一个用于捕获从java.net.URL嗅探到的URL,并将callig软件包名称和URL记录到logcat和Xposed日志中。 使用DalvikVM在运行Android 4.4.4且允许SELinux设置为允许的Nexus 5上进行构建和测试。 目前,URLSniffer尚未经过ART的测试。 它是一类,少于100行代码。 阅读它,或者不用担心。 v1.0(初始发行版) 挂钩URL,记录对Xposedlog和Logcat的调用 The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and asso
MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ri