Spring中集成Quartz时遭遇Failure obtaining db row lock异常

PostgreSQL错误解决:ERROR: CURRENT TRANSACTION IS ABORTED, COMMANDS IGNORED UNTIL END OF TRANSA 错误出现: 含有错误的查询后,选中insert语句无法执行,报错current transaction is aborted, commands ignored until end of transaction block 分析: 事务中含有错误,再执行DML时,事务无法正常进行。 我们在PG数据库,关闭了事务的自动提交的情况下,会经常的遇到这样的问题 ERROR: current transaction is aborted, commands ignored until end of tr... 阅读详情

今天在一个新的项目中用Spring集成Quartz来进行任务调度,和以往一样,配置好JobDetail、Trigger、SchedulerFactoryBean启动,却遭遇到如下异常信息:

这是一个很奇怪的错误,从打印的异常信息可以看出:quartz试图将任务执行情况持久化到数据库中,一般是在集群环境中使用的一种同步任务的方法,保证某一时刻集群中只有一台机器执行定时任务。
但是,令我奇怪的是,第一,我没有配置quartz的数据源信息;第二,我也没有配置quartz的cluster,quartz应该是在内存中维护任务列表才对。因为我们根本就没有自定义quartz.properties。

从日志上看,这的确是Quartz抛出来的异常,而且就是SchedulerFactoryBean.createScheduler时出现了问题;直接查看SchedulerFactoryBean的源码,惊奇的发现了dataSource这个属性!!而且在setDataSource方法注释里面说明了该属性将覆盖quartz.properties文件配置的datasource;看到这个属性就一切都明了了,原来又是Spring的自动注入惹的祸!前段时间刚刚遭遇过同类事件,具体可参见《网店版重生系列:都是Spring配置中自动注入惹的祸》; 

一般情况下我们数据源的beanId都是dataSource,所以在Spring自动注入的情况下,Spring再一次自作聪明了一把!解决办法有二:其一,取消quartz任务相关配置所在bean的自动注入,注意:无需将所有Spring配置文件中的自动注入都去西欧啊;其二:将系统数据源datasource这个beanId进行改名;

SpringBoot整合Quartz踩坑记:SQLServer游标问题导致db row lock报错的终极解决方案 本文深入解析SpringBoot整合Quartz时遇到的SQLServer游标锁问题,提供多种解决方案,包括修改数据源配置、自定义SQL方言等,帮助开发者彻底解决'db row lock'报错问题,优化定时任务调度性能。 阅读详情

相关推荐

quartz 报错:Failure obtaining db row lock: Table ‘test.QRTZ_LOCKS‘ doesn‘t exist

问题: spring-boot 整合quartz的时候,连接windows的mysql的时候好好的,然而用linux上的mysql的时候,启动就报了这个错: Failure obtaining db row lock: Table ‘test.QRTZ_LOCKS’ doesn’t exist 分析: 首先用windows的mysql是没问题的。 其实linux的mysql也是有这个表的,但由于是从windows复制过去的,所以表名都是小写的,而quartz启动的时候找的是大写,所以认为test.QRTZ

zhangsir的博客 2万+

org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'xxx.qrtz_LOCKdoesn

在启动springboot集成quartz定时任务报错信息 org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'aly_uias.qrtz_LOCKS' doesn't exist 异常信息表明:在创建quartz自带表时,表明是小写的,程序中使用的是大写表明,由于mysql数据库...

芋头 8625

Springboot+sqlserver+Quartz整合报错: Failure obtaining db row lock: 第 1 行: 只有 DECLARE CURSOR 才允许使用 FOR U

1.报错信息 org.springframework.context.ApplicationContextException: Failed to start bean 'quartzScheduler'; nested exception is org.springframework.scheduling.SchedulingException: Could not start Quartz Scheduler; nested exception is org.quartz.SchedulerConfig

baidu_39212797的博客 7336

spring quartz 定时器报错

Caused by: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'driverbible.qrtz_locks' doesn't exist [See nested exce...

chengyu0485的博客 393

c语言实现语音检测vad_壹鸽技术科普·智能语音客服系统中的前端语音处理技术...

随着智能客服机器人产业的迅速发展,尤其是伴随着人工智能AI的风潮,预计在2020年我国智能客服市场将达到万亿级别。在智能客服机器人领域中对电话信道语音进行端点检测处理的应用正在不断扩展和深化。目前语音端点检测(Voice Active Detection,简称VAD)的主要任务是准确快速判决出待处理的语音信号有话还是无话,作为自动语音识别(Automatic Speech Recognition,...

weixin_36431018的博客 512

手把手教你用OPA运放和MOS管搭建恒流源电路(附完整电路图)

本文详细介绍了如何使用OPA运放和MOS管搭建高精度恒流源电路,涵盖核心元器件选型、电路设计、工作原理及实际搭建步骤。通过负反馈控制机制和MOS管工作区设置技巧,实现稳定的电流输出,适用于LED驱动、电池充电等场景。附完整电路图和调试技巧,助您快速掌握恒流源设计。

weixin_29239279的博客 548

springboot后端启动报错Failure obtaining db row lock: Table ‘linfengcommunity.QRTZ_LOCKS‘ doesn‘t exist

而项目中使用的 Quartz 定时任务框架生成的表为小写,程序调用时用了大写,导致找不到表。,表示配置生效,问题解决。

2301_79296001的博客 114

PIV实验流场流速云图(MALAB contour函数用法)

clear;clc; for k=1:5 str1=['filename1']; str2=['filename2']; str3=['filename3']; str=eval(['str',num2str(k)]); load(str); [m n]=size(y); y=flipud(y); v=-v; x=x-x(1,...

Nick_Cui的博客 3232

Spring+Quartz实现定时任务的配置方法

1、Scheduler的配置     说明:Scheduler包含一个Trigger列表,每个Trigger表示一个作业。 2、Trigger的配置

hety119的专栏 642

基于YOLOv8与UI界面的校园垃圾分类督导系统

YOLO(You Only Look Once)是目前最为广泛使用的目标检测算法之一。它通过一次前向传递即完成目标检测,具有极高的速度与效率。YOLOv8是YOLO系列的最新版本,相比于之前的YOLO版本,YOLOv8在速度、精度、检测能力等方面都有了显著的提升。本项目通过结合YOLOv8模型与UI界面,成功实现了校园垃圾分类督导系统。该系统能够自动识别不同类型的垃圾,并通过UI界面实时展示垃圾分类的结果。

YOLO 342

基于若依的ruoyi-nbcio-plus支持VForm3表单字段数据保存到数据库的一种方法——全网首创(三)

基于若依的ruoyi-nbcio-plus支持VForm3表单字段数据保存到数据库的一种方法——全网首创(三)

宁波阿成的博客 529

Spring Quartz *.QRTZ_LOCKS' doesn't exist

    ERROR [org.springframework.web.context.ContextLoader] - Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework...

weixin_34056162的博客 3087

AI大模型探索之路-认知篇1-全景透视:揭秘AIGC技术的进化之路

随着人工智能技术的突飞猛进,内容创作方式的发生了革命性的转变;从早期专业人员主导的内容生产,到现如今生成式人工智(AIGC)能创作时代;本篇文章主要讲解AIGC技术的演变历程。

寻道AI,探索AI无限可能! 1657

记springboot项目启动Communications link failure

1.项目启动时报如下异常: 2020-02-26 10:09:36.387 ERROR [main] ExApplicationRunListener:223-- 启动失败 com.acooly.module.scheduler.exceptions.SchedulerEngineException: [task1]启动失败:[task1]启动失败:Failure obtaining db row...

slsu的博客 5090

Fiori Elements 从入门到精通开发教程的文章目录

Fiori Elements 开发技术相对 SAP 其他历史悠久,发展成熟的开发技术来说,是一个新事物。正因如此,迄今为止国内深入讲解 Fiori Elements 应用的中文材料几乎没有。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 5171

UNet 改进(39):结合残差连接与CBAM注意力机制的unet模型

本文提出了一种改进的UNet架构,通过融合残差连接和CBAM注意力机制来增强医学图像分割性能。该网络保留UNet的U形结构,但将基础模块替换为ResidualBlock和CBAM的组合:残差块通过快捷连接解决梯度消失问题,CBAM模块结合通道和空间注意力机制突出重要特征。整体架构采用编码器-解码器设计,包含5个下采样和上采样阶段,通过跳跃连接融合多尺度特征。实验表明,这种改进显著提升了原始UNet的性能,特别适用于需要精细边界的医学图像分割任务。

2401_82355416的博客 1049

org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table ‘india_framework.QR

将Windows上的mysql数据迁移到Linux上后,报这个错:org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'india_framework.QRTZ_LOCKS' doesn't exist首先用windows的mysql是没问题的。 其实linux的mysql也是有这个表的,但由于是从windows复制过去的,所以表名都是小写的,而quartz启动的时候找的是大写,所以认为test.Q

m0_72560900的博客 3000

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

为什么开发人员必须要了解数据库锁?

1.锁? 1.1何为锁 锁在现实中的意义为:封闭的器物,以钥匙或暗码开启。在计算机中的锁一般用来管理对共享资源的并发访问,比如我们java同学熟悉的Lock,synchronized等都是我们常见的锁。当然在我们的数据库中也有锁用来控制资源的并发访问,这也是数据库和文件系统的区别之一。 1.2为什么要懂数据库锁? 通常来说对于一般的开发人员,在使用数据库的时候一般懂点DQL(select),DML...

weixin_34406796的博客 549

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

成功解决:Caused by: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock

当在IDEA中配置了云服务器的MySQL Caused by: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'amops.QRTZ_LOCKS' doesn't exist 因为在Linux平台下面MySQL默认是严格区分大小写的,需要去修改MySQL的配置文件 sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 在mysqld下添加以下内容 lower

GniLAY1022的博客 4510

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

数据库导入或运行时报错Failure obtaining db row lock: Table ‘linfengcommunity.QRTZ_LOCKS‘ doesn‘t exist

linfengcommunity数据库导入或运行时报错Failure obtaining db row lock: Table 'linfengcommunity.QRTZ_LOCKS' doesn't exist

weixin_43963518的博客 1870

nested exception is java.sql.SQLException: connection disabled

当使用Spring Boot连接数据库时,出现"nested exception is java.sql.SQLException: connection disabled"异常可能是由于数据库配置错误、数据库服务器故障、连接池配置问题或数据库访问权限不足引起的。数据库权限问题:数据库用户可能没有足够的权限来连接数据库或执行所需的操作。验证数据库权限:确保数据库用户具有足够的权限来连接数据库和执行所需的操作。检查数据库连接配置:确保数据库连接的URL、用户名和密码正确配置,并与实际数据库的凭据匹配。

Java老兵的后端进阶与AI前沿探索之路。 1万+

解决:Caused by: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock

当在IDEA中配置了云服务器的MySQL Caused by: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'amops.QRTZ_LOCKS' doesn't exist 因为在Linux平台下面MySQL默认是严格区分大小写的,需要去修改MySQL的配置文件 sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 在mysqld下添加以下内容

爱吃橙子蜂蜜酱的熊 2546

QUARTZ 报错:FAILURE OBTAINING DB ROW LOCK: TABLE ‘TEST.QRTZ_LOCKS‘ DOESN‘T EXIST

mysql有个配置属性:lower_case_table_names windows上安装mysql,默认是1, linux上安装mysql,默认是0,代表不忽略大小写 在my.cnf配置文件中[mysqld]标签的作用区域,增加lower_case_table_names=1的配置,然后重启MySQL服务 修改/etc/my.cnf文件 保存退出,重启mysql即可 ...

bblo 1624
上一篇: 网店版重生系列:多数据源单sqlMapClient导致NullPointerException问题跟踪
下一篇: 探讨:研发中心应该包括的核心元素模型
sfdev
博客等级 码龄22年 468粉丝 134原创
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址