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 ...
随机推荐
- os内置模块
import os 1.os.getcwd() # 获得当前文件路径 2.os.chdir() # 改变当前目录 3.os.curdir # . 表示当前目录 4.os.pardir # 表示上 ...
- Fiddler 链接到逍遥安卓模拟器
参考: http://www.xyaz.cn/thread-4664-1-1.html 1丶启动Fiddler,打开菜单栏中的 工具 >Fiddler选项 ,打开“Fiddler选项”对话框. ...
- 10 python os&sys 模块
1.os模块 os模块提供了很多允许你的程序与操作系统直接交互的功能 os模块的主要功能:处理文件和目录,系统相关,执行命令,管理进程 检验给出的路径是否是一个文件:os.path.isfile() ...
- UI5-文档-4.37-Content Density
在本演练教程的这一步中,我们将根据用户的设备调整内容密度.SAPUI5包含不同的内容密度,允许您为支持触摸的设备显示更大的控件,为鼠标操作的设备显示更小.更紧凑的设计.在我们的app中,我们将检测设备 ...
- UI5-文档-4.29-Integration Test with OPA
如果我们想测试我们的应用程序的交互模式或更多的可视化特性,我们也可以编写一个集成测试. 我们还没有想过测试我们与app的交互,所以在这一步中,我们将在点击“Say Hello with dialog” ...
- dmidecode详解
1.DMI简介 DMI (Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行. SMBI ...
- hibernate中1对1的注解配置
hibernate中1对1的注解配置分为:外键关联映射和主键关联映射 1.外键配置 //一方@Entity@Table(name="test_classinfo")public c ...
- How to create a Virtual Machine in SmartOS
在SmartOS中,使用vmadm创建工具创建虚拟机. 此工具需要一个JSON有效负载,并使用输入JSON中指定的属性创建“kvm”或“joyent” brand zone. 正常输出是一系列单行JS ...
- 利用R产生随机数
生成随机数有两个函数runif()和rnorm(),其中r表示的是random随机的意思,unif表示的是均匀分布,而norm表示的是正态分布. 1)生成10个2到3之间的,服从均匀分布的随机数:ru ...
- intellij idea 的常见配置
1.视图配置 配置好后如下图: 2.修改字体大小 3.编码修改 4.行号显示 5.控制台字体大小调整 File->Settings->Editor->Colors & F ...