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
描述:框架注入时候,配置了事物管理,权限设置的只读模式

解决方法不是什么把它删了,删了就没安全防护了,肯定不是对的方法。
解决方案一:
如果调用的service中的方法使用了修改,添加功能,并且继承了父类,那么需要将自己的service更新方法的名称添加到这个里边
<tx:method name="mygetOrder" propagation="REQUIRED" read-only="true"/>
解决方案二:
修改事物加载的权限模式,修改注解

关闭事物加载的只读模式,默认是开启的
@Transactional(readOnly = false)
java最全的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
org.springframework.dao.TransientDataAccessResourceException: ### Error updating database. Cause: ja ...
- [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 ...
- 执行update操作的话,就会报“Connection is read-only. Queries leading to data modification are not allowed”的异常。
我用的是 spring + springmvc + mybatis +mysql. <tx:advice id="txAdvice" transaction-manager= ...
- Connection is read-only. Queries leading to data modification are not allowed
看了下mysql-connector-5.1.40版本中,如果设置failoverReadOnly=true (即默认值,参考链接),当mysql连接failover时,会根据jdbc连接串将当前连接 ...
- 详细解读 :java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed,Java报错之Connection is read-only.
问题分析: 实际开发项目中,进行insert的时候,产生这个问题是Spring框架的一个安全权限保护方法,对于方法调用的事物保护,一般配置如下: <!-- 事务管理 属性 --> < ...
- Connection is read-only. Queries leading to data modification are not allowed 错误原因
因为我再spring 中使用了AOP进行事务管理,有如下配置 <tx:advice id="txAdvice" transaction-manager="trans ...
- 执行新增和修改操作报错connection is read-only. Queries leading to data modification are not allowed
出现这个问题的原因是默认事务只有只读权限,因此要添加下面的每一个add*,del*,update*等等. 分别给予访问数据库的权限. 方法名的前缀有该关键字设置了read-only=true,将其改为 ...
- Java socket 说明 以及web 出现java.net.SocketException:(Connection reset或者Connectreset by peer:Socket write error)的解释
另外http://www.cnblogs.com/fengmk2/archive/2007/01/15/using-Socket.html可供参考 一Java socket 说明 所谓socket ...
- 关于java.sql.SQLRecoverableException: Closed Connection异常的解决方案(转)
在项目中碰到了一个应用异常,从表象来看应用僵死.查看Weblogic状态为Running,内存无溢出,但是出现多次线程堵塞.查看Weblogic日志,发现程序出现多次Time Out. 我们知道,We ...
随机推荐
- 边框(border)宽度样式颜色 和基本属性
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- unity WWW加载进度条
using UnityEngine; using System.Collections; public class testProgress : MonoBehaviour { void Start ...
- 从给定字符串中截取n个字节的字符(解决汉字截取乱码问题)
function GetNBytesChar(s: Ansistring; n: Integer): string;var aStr: AnsiString; bStr: WideString;b ...
- delphi常用函数和方法
uses ShellApi, ActiveX, ComObj, ShlObj; function HasText(Text: string; const Values: array of strin ...
- win64+anaconda+xgboost(转)
Windows下安装python版的XGBoost(Anaconda) XGBoost是近年来很受追捧的机器学习算法,由华盛顿大学的陈天奇提出,在国内外的很多大赛中取得很不错的名次, ...
- python中迭代问题
迭代list的时候不能修改这个list,否则,可能会出错. numbers=[1,0,3,5,0] numbers.sort() print(numbers) print('************* ...
- shell脚本面试题
Q:1 Shell脚本是什么.它是必需的吗? 答:一个Shell脚本是一个文本文件,包含一个或多个命令.作为系统管理员,我们经常需要使用多个命令来完成一项任务,我们可以添加这些所有命令在一个文本文件( ...
- Spring ThreadPoolTaskExecutor
1. ThreadPoolTaskExecutor配置 1 <!-- spring thread pool executor --> 2 <bean id="taskExe ...
- Windows内置系统账户:Local system/Network service/Local Service 区别
LocalSystem 账户 LocalSystem是预设的拥有本机所有权限的本地账户,这个账户跟通常的用户账户没有任何关联,也没有用户名和密码之类的凭证.这个服务账户可以打开注册表的HKEY_LO ...
- input上传图片
1.通过input自身的onchange事件触发: <input id="file" type="file" accept="image/*&q ...