ssh中Connection is read-only问题的产生原因与解决方法
来源:互联网 发布:看报纸的软件 编辑:程序博客网 时间:2024/04/28 04:50
ssh中Connection is read-only问题的产生原因与解决方法
在前段时间用ssH 写一个小例子,怎么都不能插入数据,看报错是;“Connection is read-only. Queries leading to data modification are not allowed”
后来查阅资料才知道一般如果报了这个错,估计是ssh中事物配置文件的问题。
<!-- 拦截器方式配置事物 --><tx:advice id="transactionAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="insert*" propagation="REQUIRED" read-only="true"/>
<tx:method name="add*" propagation="REQUIRED" /> <tx:method name="do*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" read-only="true"/> <tx:method name="change*" propagation="REQUIRED" /> <tx:method name="edit*" propagation="REQUIRED"/> <tx:method name="process*" propagation="REQUIRED" /> <tx:method name="saveOrUpdate*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="grant*" propagation="REQUIRED" /> <tx:method name="llm*" propagation="REQUIRED" /> <tx:method name="init*" propagation="REQUIRED" /> <tx:method name="*" propagation="REQUIRED" read-only="true" /> </tx:attributes></tx:advice><aop:config>
这里面规定了数据库操作函数必须要以以上字符串开头,否则的话就按照默认的配置,对数据库访问的权限为read-only。
所以很有可能是你起了一个名字,不在你的配置库中。
一般来说一个数据库操作类XXService都是继承基类 DAO.
数据库操作类XXService中的方法在执行的时候,会和事务配置表中的进行对比,并赋给相应的权限。
解决办法:
解决方案有2种
1.规范命名
2.删除read-only="true" ,但是这种方法不推荐,因为有可能会出现一些你想不到的问题,或者是对服务器的性能造成影响。
3.把你新起的名字的方法,配置到里面,标红的是我自己写的时候没有配置的方法,配置上后问题完美的结局。
0 0
- ssh中Connection is read-only问题的产生原因与解决方法
- ssh中Connection is read-only问题的产生原因与解决方法
- ssh中Connection is read-only问题的产生原因与解决方法
- Connection is read-only问题的产生原因与解决方法
- ssh中read-only的一种解决方法
- 解决ssh中Connection is read-only. Queries leading to data modification are not allowed
- mysql中Table is read only的解决方法
- mysql中Table is read only的解决方法小结
- mysql中Table is read only的解决方法
- Database is read-only 的解决方法
- mysql的table is read only 解决方法
- Read-only file system问题的解决方法
- spring定时任务 Connection is read-only
- Fedora11上安装bugzilla出现 max_allowed_packet is read-only问题的解决方法
- linux下mysql error #1036 - Table 'xxxx' is read only问题的解决方法
- mysql提示Table is read only的解决方法
- mysql中Table is read only的解决
- Ubuntu下mysql中Table is read only的解决
- 自定义listview中android:descendantFocusability的属性作用
- iOS动画效果和实现
- 设计模式笔记-装饰者模式
- 跳转界面加载 进度条
- 2039 骑马修栅栏 USACO[图论—欧拉路]
- ssh中Connection is read-only问题的产生原因与解决方法
- 异常处理机制
- 平时在工作或上网时看到的好书
- swift AppDelegate中的方法
- nginx第3方模块编译 及nginx 与php 一致性对memcahce哈希应用
- Linux中wc命令介绍
- START WITH CONNECT BY PRIOR子句实现递归查询
- sass 跟 less 在项目使用选择时做了个比较,借鉴
- Java--Tomcat服务器学习和使用(二)