Caused by: java.sql.SQLException: Connection is read-only. Queries leading to da

[color=red]错误信息:[/color]
Caused by: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed 有人遇到过这个问题吗? 可以查询 添加 删除 但是修改的时候 就报这个错误,别人机子上就可以正常修改 急求!!!????(已排除配置文件设置只读和数据库用户没有权限)


[img]http://dl2.iteye.com/upload/attachment/0109/1421/593133d9-75d3-3087-a276-caaef503506c.png[/img]

[color=red]解决办法:[/color]
1. 查看spring配置是否设置只读




readOnly
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED, readOnly,-Exception
PROPAGATION_REQUIRED, -Exception




2. spring事务是否设置只读:解决方法:把 干掉
3. 数据库是否拥有权限
4.强制修改是否可读写:
//如果有事务,那么加入事务,没有的话新建一个(不写的情况下),readOnly=true只读,不能更新,删除(默认为false)
@Transactional (propagation = Propagation.REQUIRED,readOnly=false)

你可能感兴趣的:(Caused by: java.sql.SQLException: Connection is read-only. Queries leading to da)