java.sql.SQLException: Connection is read-only. Queries leading to data modification are not

产生的原因:
事务中查询的方法中,嵌套了新增或修改的方法,会报该异常。
解决方法:
找到报错的方法,在该方法上加上注解,@Transactional(readOnly = false)

业务上加了事务控制,意思是只能查询不能增加、修改或者删除,如果需要执行的这个操作,则需要修改事务的控制
将事务控制的readOnly的值改成false即可

DEMO:
@Transactional(readOnly = false) //加上这个注解
public void saveLog(ProceedingJoinPoint joinPoint, long time, Object proceed) { }

java.sql.SQLException: Connection is read-only. Queries leading to data modification are not的更多相关文章

  1. java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

    org.springframework.dao.TransientDataAccessResourceException: ### Error updating database. Cause: ja ...

  2. [Done]java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

    java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed ...

  3. java.sql.SQLException: connection holder is null;

    一.问题来源分析 出现的错误 : Cause: java.sql.SQLException: connection holder is null; uncategorized SQLException ...

  4. java.sql.SQLException: connection holder is null 问题处理

    问题描述 上上个周测试的时候突然报系统异常,于是我立即查看日志,发现是一个数据库异常:java.sql.SQLException: connection holder is null我第一想到的就是可 ...

  5. java最全的Connection is read-only. Queries leading to data modification are not allowed

    Connection is read-only. Queries leading to data modification are not allowed 描述:框架注入时候,配置了事物管理,权限设置 ...

  6. Connection is read-only. Queries leading to data modification are not allowed

    看了下mysql-connector-5.1.40版本中,如果设置failoverReadOnly=true (即默认值,参考链接),当mysql连接failover时,会根据jdbc连接串将当前连接 ...

  7. 执行update操作的话,就会报“Connection is read-only. Queries leading to data modification are not allowed”的异常。

    我用的是 spring + springmvc + mybatis +mysql. <tx:advice id="txAdvice" transaction-manager= ...

  8. 详细解读 :java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed,Java报错之Connection is read-only.

    问题分析: 实际开发项目中,进行insert的时候,产生这个问题是Spring框架的一个安全权限保护方法,对于方法调用的事物保护,一般配置如下: <!-- 事务管理 属性 --> < ...

  9. 开发中遇到的Cause: java.sql.SQLException: connection holder is null的异常

    异常的出现是属于获取连接超时,从而找不到持有者. 项目中的配置体现: <property name="removeAbandoned" value="true&qu ...

  10. Connection is read-only. Queries leading to data modification are not allowed 错误原因

    因为我再spring 中使用了AOP进行事务管理,有如下配置 <tx:advice id="txAdvice" transaction-manager="trans ...

随机推荐

  1. 一文带你了解企业上云数据分析首选产品Quick BI

    简介: 阿里云Quick BI再度入选,并继续成为该领域唯一入选魔力象限的中国企业,文章将为大家详细介绍上云数据分析首选产品 Quick BI的核心能力. 日前,国际权威分析机构Gartner发布20 ...

  2. 用手机写代码:基于 Serverless 的在线编程能力探索

    ​简介:Serverless 架构的按量付费模式,可以在保证在线编程功能性能的前提下,进一步降低成本.本文将会以阿里云函数计算为例,通过 Serverless 架构实现一个 Python 语言的在线编 ...

  3. WPF 已知问题 开启 IsManipulationEnabled 之后触摸长按 RepeatButton 不会触发连续的 Click 事件

    本文记录 WPF 的一个已知问题,在 RepeatButton 上开启 IsManipulationEnabled 漫游支持之后,将会导致触摸长按到 RepeatButton 之上时,不会收到源源不断 ...

  4. dotnet C# 如果在构造函数抛出异常 是否可以拿到对象赋值的变量

    如果使用某个变量去获取某个类型的对象创建,但是在这个类型的构造函数调用时抛出异常,请问此变量是否可以拿到对应的对象 如下面代码 private void F1() { Foo foo = null; ...

  5. VGA色块显示#VGA显示数字

    VGA驱动色块显示 了解了VGA的显示原理和ADV7123控制后,再去实现色块显示就容易了. 像素坐标 跟显示色条不同,要在屏幕上不同的地方显示色块,需要用像素坐标来定位色块.其实,就是分别用行扫描的 ...

  6. 开源相机管理库Aravis例程学习(六)——camera-features

    目录 简介 例程代码 函数说明 arv_camera_get_integer arv_camera_get_string 简介 本文针对官方例程中的:04-camera-features做简单的讲解. ...

  7. dotnet build error CS5001: Program does not contain a static 'Main' method suitable for an entry point

    前言 Docker环境编译.Net6项目,出现诡异的CS5001 Program does not contain a static 'Main' method suitable for an ent ...

  8. 【保姆级Python入门教程】马哥手把手带你安装Python、安装Pycharm、环境配置教程

    您好,我是 @马哥python说 ,一枚10年程序猿. 我的社群中小白越来越多,咨询讨论的问题很多集中在python安装上,故输出此文,希望对大家起步有帮助. 下面开始,先安装Python,再安装py ...

  9. DP-Modeler三维修模软件简介

    图像快速建模系统DP-Modeler是天际航自主研发的一款集精细化单体建模及Mesh网格模型修饰于一体的新型软件.通过特有的摄影测量算法,支持航测摄影.无人机影像.地面影像.车载影像.激光点云等多数据 ...

  10. pageoffice 6 实现数据区域填充(插入文本、图片、word、excel等)

    在实际的Word文档开发中,经常需要自动填充数据到Word模板中,以生成动态的Word文档. 例如: 1.我们可以根据数据库表中已保存的个人信息,设计好一个简历模板docx文件,然后通过代码将这些个人 ...